From ca26db30a0bebbf491f5c976949c0645ceedabf4 Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 20 Feb 2025 10:48:55 +1100 Subject: [PATCH] slh-dsa: avoid pairwise test when doing key generation CAST Reviewed-by: Shane Lontis Reviewed-by: Tomas Mraz Reviewed-by: Viktor Dukhovni (Merged from https://github.com/openssl/openssl/pull/26838) --- providers/implementations/keymgmt/slh_dsa_kmgmt.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/implementations/keymgmt/slh_dsa_kmgmt.c b/providers/implementations/keymgmt/slh_dsa_kmgmt.c index 27fee6c2b86..f4df2e8813c 100644 --- a/providers/implementations/keymgmt/slh_dsa_kmgmt.c +++ b/providers/implementations/keymgmt/slh_dsa_kmgmt.c @@ -12,6 +12,7 @@ #include #include #include "crypto/slh_dsa.h" +#include "internal/fips.h" #include "internal/param_build_set.h" #include "prov/implementations.h" #include "prov/providercommon.h" @@ -295,6 +296,10 @@ static int slh_dsa_fips140_pairwise_test(SLH_DSA_HASH_CTX *ctx, uint8_t *sig = NULL; size_t sig_len; + /* During self test, it is a waste to do this test */ + if (ossl_fips_self_testing()) + return 1; + OSSL_SELF_TEST_get_callback(lib_ctx, &cb, &cb_arg); st = OSSL_SELF_TEST_new(cb, cb_arg); if (st == NULL) -- 2.47.2