Skip LMS tests if fetch for the LMS algorithm fails

Check for specific LMS error

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28580)
This commit is contained in:
Andrew Dinh 2025-09-17 11:49:59 +10:00 committed by Neil Horman
parent bea53924ce
commit 3b00a13229
1 changed files with 6 additions and 0 deletions

View File

@ -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);