diff options
author | Matt Caswell <matt@openssl.org> | 2020-08-07 17:20:18 +0100 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-08-29 17:40:09 +1000 |
commit | 1bf625040c9a1f02782c9b4f993e1a58e6e70448 (patch) | |
tree | 6a27e008ad508db767f6b8865822bfea03eb9a68 /test | |
parent | b571e662cdc06febabeac3a117726deaf812afd7 (diff) | |
download | openssl-1bf625040c9a1f02782c9b4f993e1a58e6e70448.zip openssl-1bf625040c9a1f02782c9b4f993e1a58e6e70448.tar.gz openssl-1bf625040c9a1f02782c9b4f993e1a58e6e70448.tar.bz2 |
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 <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12637)
Diffstat (limited to 'test')
-rw-r--r-- | test/evp_extra_test.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 4da65a2..de5158f 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; |