summaryrefslogtreecommitdiffstats
path: root/test/evp_extra_test.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2020-12-08 10:13:54 -0500
committerRichard Levitte <levitte@openssl.org>2021-01-21 12:08:46 +0100
commita3d267f18492a1e874534d5af6072bc8b7a290e5 (patch)
treec52694a08afe3ee51be563a2ebb6118acf63d44f /test/evp_extra_test.c
parent3aa7212e0a4fd1533c8a28b8587dd8b022f3a66f (diff)
Deprecate EVP_KEY_new_CMAC_key and EVP_PKEY_new_CMAC_key_ex
EVP_KEY_new_CMAC_key_ex was in the pre-release 3.0 only, so is safe to remove. Restore 1.1.1 version of EVP_PKEY_new_CMAC_key documentation. Also make testing of EVP_PKEY_new_CMAC_key properly #ifdef'd. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13829)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r--test/evp_extra_test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 42f4319d6c..37efbd42e2 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -1538,7 +1538,10 @@ static int test_CMAC_keygen(void)
EVP_PKEY_CTX *kctx = EVP_PKEY_CTX_new_id(EVP_PKEY_CMAC, NULL);
int ret = 0;
EVP_PKEY *pkey = NULL;
- unsigned char mac[AES_BLOCK_SIZE], mac2[AES_BLOCK_SIZE];
+ unsigned char mac[AES_BLOCK_SIZE];
+# if !defined(OPENSSL_NO_DEPRECATED_3_0)
+ unsigned char mac2[AES_BLOCK_SIZE];
+# endif
/* Test a CMAC key created using the "generated" method */
if (!TEST_int_gt(EVP_PKEY_keygen_init(kctx), 0)
@@ -1553,6 +1556,7 @@ static int test_CMAC_keygen(void)
|| !TEST_true(get_cmac_val(pkey, mac)))
goto done;
+# if !defined(OPENSSL_NO_DEPRECATED_3_0)
EVP_PKEY_free(pkey);
/*
@@ -1564,6 +1568,7 @@ static int test_CMAC_keygen(void)
|| !TEST_true(get_cmac_val(pkey, mac2))
|| !TEST_mem_eq(mac, sizeof(mac), mac2, sizeof(mac2)))
goto done;
+# endif
ret = 1;