summaryrefslogtreecommitdiff
path: root/test/evp_extra_test.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-08-05 10:28:51 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-03 17:48:32 +0200
commita10847c427744fb7e7d29953dee130a52251c027 (patch)
treea009c19372810a87154460cbbebe6e106dcf88c4 /test/evp_extra_test.c
parentb5275648843ace1a441521823913ccbbebb8769c (diff)
downloadopenssl-new-a10847c427744fb7e7d29953dee130a52251c027.tar.gz
"Downgrade" provider-native keys to legacy where needed
Some sub-systems and openssl sub-commands do not yet deal cleanly with purely provider-native EVP_PKEYs. We compensate that by "downgrading" keys in select places, or ensure that the 'file:' scheme ENGINE loader is activated. Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12587)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r--test/evp_extra_test.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index bae6f2339b..f62e26c290 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -33,6 +33,14 @@
#include "internal/sizes.h"
#include "crypto/evp.h"
+#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;
/*
@@ -881,6 +889,11 @@ 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)))
goto done;