From: Andrew Dinh Date: Wed, 17 Sep 2025 01:49:59 +0000 (+1000) Subject: Skip LMS tests if fetch for the LMS algorithm fails X-Git-Tag: openssl-3.6.0~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba0062ee23c54069654aaadb91c33cc6afed8d6b;p=thirdparty%2Fopenssl.git Skip LMS tests if fetch for the LMS algorithm fails Check for specific LMS error Reviewed-by: Neil Horman Reviewed-by: Paul Dale Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/28580) (cherry picked from commit 3b00a132291ef83cc349b8f1f27d7daec3b43388) --- diff --git a/test/lms_test.c b/test/lms_test.c index 46b42644302..96fff510d47 100644 --- a/test/lms_test.c +++ b/test/lms_test.c @@ -551,6 +551,7 @@ int setup_tests(void) { OPTION_CHOICE o; char *config_file = NULL; + EVP_PKEY_CTX *ctx = NULL; /* Swap the libctx to test non-default context only */ propq = "provider=default"; @@ -571,6 +572,11 @@ int setup_tests(void) if (!test_get_libctx(&libctx, &nullprov, config_file, &libprov, NULL)) return 0; + ctx = EVP_PKEY_CTX_new_from_name(libctx, "LMS", propq); + if (ctx == NULL && ERR_get_error() == EVP_R_UNSUPPORTED_ALGORITHM) + return TEST_skip("LMS algorithm is not available in provider"); + EVP_PKEY_CTX_free(ctx); + ADD_TEST(lms_bad_pub_len_test); ADD_TEST(lms_key_validate_test); ADD_TEST(lms_key_eq_test);