zkey: Enhance APQN cross check to check for firmware version

EP11 secure keys require a certain firmware version. Enhance
the APQN cross check to not only check for a minimum card level,
but also for a minimum firmware version.

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:
Ingo Franzki
2019-11-20 10:17:46 +01:00
committed by Jan Höppner
parent a7e47685e0
commit 88e6a18f96
7 changed files with 79 additions and 14 deletions

View File

@@ -26,6 +26,7 @@
#include "lib/util_panic.h"
#include "pkey.h"
#include "utils.h"
#ifndef AF_ALG
#define AF_ALG 38
@@ -1708,6 +1709,20 @@ int get_min_card_level_for_keytype(const char *key_type)
return -1;
}
const struct fw_version *get_min_fw_version_for_keytype(const char *key_type)
{
static const struct fw_version ep11_fw_version = {
.major = 0, .minor = 0, .api_ordinal = 4, };
if (key_type == NULL)
return NULL;
if (strcasecmp(key_type, KEY_TYPE_EP11_AES) == 0)
return &ep11_fw_version;
return NULL;
}
/**
* Returns the card type required for a specific key type
*