]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
TEST: Remove use of EVP_PKEY_set_alias_type() in test/evp_extra_test.c
authorRichard Levitte <levitte@openssl.org>
Wed, 23 Sep 2020 04:18:06 +0000 (06:18 +0200)
committerRichard Levitte <levitte@openssl.org>
Fri, 25 Sep 2020 09:07:42 +0000 (11:07 +0200)
We already test EVP_PKEY_set_alias_type() quite thoroughly in
test/ecdsatest.c, that should be enough.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/12920)

test/evp_extra_test.c

index b26dfb6be32eceb150dc128599067f6b8954ec08..afb9966bfa90ae09deffe6105f23dbe23d34338b 100644 (file)
 #include "crypto/evp.h"
 #include "../e_os.h" /* strcasecmp */
 
-#ifndef OPENSSL_NO_SM2
-/*
- * TODO(3.0) remove when provider SM2 keymgmt is implemented and
- * EVP_PKEY_set_alias_type() works with provider-native keys.
- */
-# define TMP_SM2_HACK
-#endif
-
 static OPENSSL_CTX *testctx = NULL;
 
 /*
@@ -954,12 +946,7 @@ static int test_EVP_SM2_verify(void)
     if (!TEST_true(pkey != NULL))
         goto done;
 
-#ifdef TMP_SM2_HACK
-    if (!TEST_ptr(EVP_PKEY_get0(pkey)))
-        goto done;
-#endif
-
-    if (!TEST_true(EVP_PKEY_set_alias_type(pkey, EVP_PKEY_SM2)))
+    if (!TEST_true(EVP_PKEY_is_a(pkey, "SM2")))
         goto done;
 
     if (!TEST_ptr(mctx = EVP_MD_CTX_new()))