mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zkey: Check crypto card level during APQN cross checking
Secure keys of type CCA-AESCIPHER require a CEX6C or newer crypto card. Also check for the minimum required card level during cross checking of APQNs. Also display the card level in the APQN report. Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com> Reviewed-by: Harald Freudenberger <freude@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
560b672bfa
commit
b7bb90c552
20
zkey/pkey.c
20
zkey/pkey.c
@@ -1630,3 +1630,23 @@ const char *get_key_type(const u8 *key, size_t key_size)
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the minimum card level for a specific key type
|
||||
*
|
||||
* @param[in] key_type the type of the key
|
||||
*
|
||||
* @returns the minimum card level, or -1 for unknown key types
|
||||
*/
|
||||
int get_min_card_level_for_keytype(const char *key_type)
|
||||
{
|
||||
if (key_type == NULL)
|
||||
return -1;
|
||||
|
||||
if (strcasecmp(key_type, KEY_TYPE_CCA_AESDATA) == 0)
|
||||
return 3;
|
||||
if (strcasecmp(key_type, KEY_TYPE_CCA_AESCIPHER) == 0)
|
||||
return 6;
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user