Skip to content

Commit

Permalink
evp_test: Skip testcase if r parameter is unsupported
Browse files Browse the repository at this point in the history
The r parameter of the KBKDF is unsupported by 3.0 FIPS module.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #17671)

(cherry picked from commit bbbd121)
Reviewed-by: Hugo Landau <hlandau@openssl.org>
  • Loading branch information
t8m committed Nov 11, 2022
1 parent 64e20b1 commit fa82704
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/evp_test.c
Expand Up @@ -2760,6 +2760,13 @@ static int kdf_test_ctrl(EVP_TEST *t, EVP_KDF_CTX *kctx,
if (p != NULL)
*p++ = '\0';

if (strcmp(name, "r") == 0
&& OSSL_PARAM_locate_const(defs, name) == NULL) {
TEST_info("skipping, setting 'r' is unsupported");
t->skip = 1;
goto end;
}

rv = OSSL_PARAM_allocate_from_text(kdata->p, defs, name, p,
p != NULL ? strlen(p) : 0, NULL);
*++kdata->p = OSSL_PARAM_construct_end();
Expand All @@ -2773,20 +2780,23 @@ static int kdf_test_ctrl(EVP_TEST *t, EVP_KDF_CTX *kctx,
TEST_info("skipping, '%s' is disabled", p);
t->skip = 1;
}
goto end;
}
if (p != NULL
&& (strcmp(name, "cipher") == 0
|| strcmp(name, "cekalg") == 0)
&& is_cipher_disabled(p)) {
TEST_info("skipping, '%s' is disabled", p);
t->skip = 1;
goto end;
}
if (p != NULL
&& (strcmp(name, "mac") == 0)
&& is_mac_disabled(p)) {
TEST_info("skipping, '%s' is disabled", p);
t->skip = 1;
}
end:
OPENSSL_free(name);
return 1;
}
Expand Down

0 comments on commit fa82704

Please sign in to comment.