From 1bf625040c9a1f02782c9b4f993e1a58e6e70448 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 7 Aug 2020 17:20:18 +0100 Subject: [PATCH] Fix evp_extra_test to not assume that HMAC is legacy evp_extra_test had a test that checks whether an EVP_PKEY_CTX can still be created for HMAC even though there are no providers loaded because it is a legacy algorithm. However after the earlier commits this is no longer the case. We swap the check to a different legacy algorithm (SM2). Hopefully before too long there will be no legacy algorithms left and the test can be deleted. Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/12637) --- test/evp_extra_test.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 4da65a2400d..de5158fe13f 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1760,15 +1760,17 @@ static int test_pkey_ctx_fail_without_provider(int tst) if (!TEST_ptr(nullprov)) goto err; - pctx = EVP_PKEY_CTX_new_from_name(tmpctx, tst == 0 ? "RSA" : "HMAC", ""); + pctx = EVP_PKEY_CTX_new_from_name(tmpctx, tst == 0 ? "RSA" : "SM2", ""); /* RSA is not available via any provider so we expect this to fail */ if (tst == 0 && !TEST_ptr_null(pctx)) goto err; /* - * HMAC is always available because it is implemented via legacy codepaths + * SM2 is always available because it is implemented via legacy codepaths * and not in a provider at all. We expect this to pass. + * TODO(3.0): This can be removed once there are no more algorithms + * available via legacy codepaths */ if (tst == 1 && !TEST_ptr(pctx)) goto err; -- 2.47.3