parse_tdes_uint8_hex_str(const char *key, char *src, struct fips_val *val);
static int
-parse_tdes_interim(const char *key,
- __rte_unused char *text,
- struct fips_val *val);
+parse_tdes_interim(const char *key, char *text, struct fips_val *val);
struct fips_test_callback tdes_tests_vectors[] = {
{KEYS_STR, parse_tdes_uint8_hex_str, &vec.cipher_auth.key},
struct fips_test_callback tdes_tests_interim_vectors[] = {
{ENC_STR, parse_tdes_interim, NULL},
{DEC_STR, parse_tdes_interim, NULL},
+ {NK_STR, parse_tdes_interim, NULL},
{NULL, NULL, NULL} /**< end pointer */
};
};
static int
-parse_tdes_interim(const char *key,
- __rte_unused char *text,
+parse_tdes_interim(const char *key, char *text,
__rte_unused struct fips_val *val)
{
if (strstr(key, ENC_STR))
info.op = FIPS_TEST_ENC_AUTH_GEN;
else if (strstr(key, DEC_STR))
info.op = FIPS_TEST_DEC_AUTH_VERIF;
- else if (strstr(NK_STR, "NumKeys = 1"))
- info.interim_info.tdes_data.nb_keys = 1;
- else if (strstr(NK_STR, "NumKeys = 2"))
- info.interim_info.tdes_data.nb_keys = 2;
- else if (strstr(NK_STR, "NumKeys = 3"))
- info.interim_info.tdes_data.nb_keys = 3;
- else
+ else if (strstr(key, NK_STR)) {
+ if (strcmp(text, "NumKeys = 1") == 0)
+ info.interim_info.tdes_data.nb_keys = 1;
+ else if (strcmp(text, "NumKeys = 2") == 0)
+ info.interim_info.tdes_data.nb_keys = 2;
+ else if (strcmp(text, "NumKeys = 3") == 0)
+ info.interim_info.tdes_data.nb_keys = 3;
+ else
+ return -EINVAL;
+ } else
return -EINVAL;
return 0;