diff options
author | Tomas Mraz <tomas@openssl.org> | 2022-10-12 12:22:25 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-11-11 16:56:38 +0100 |
commit | 66ecce223cedb46e7b56fcce0a1e9b3b09ee8ae5 (patch) | |
tree | 79457b89a88257844a3b08bfffdb21ca7536ba10 /test | |
parent | d90a4c7d5a18300153340a6d54e7aba03eebe268 (diff) |
test_CMAC_keygen(): Avoid using ECB cipher with CMAC
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19401)
(cherry picked from commit a0783b83a3bd05a07ea64567995c7642621b4aa6)
Diffstat (limited to 'test')
-rw-r--r-- | test/evp_extra_test.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 3dd9503fb9..5bd4a85933 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -2344,7 +2344,7 @@ static int test_CMAC_keygen(void) if (!TEST_int_gt(EVP_PKEY_keygen_init(kctx), 0) || !TEST_int_gt(EVP_PKEY_CTX_ctrl(kctx, -1, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_CIPHER, - 0, (void *)EVP_aes_256_ecb()), 0) + 0, (void *)EVP_aes_256_cbc()), 0) || !TEST_int_gt(EVP_PKEY_CTX_ctrl(kctx, -1, EVP_PKEY_OP_KEYGEN, EVP_PKEY_CTRL_SET_MAC_KEY, sizeof(key), (void *)key), 0) @@ -2360,7 +2360,7 @@ static int test_CMAC_keygen(void) * Test a CMAC key using the direct method, and compare with the mac * created above. */ - pkey = EVP_PKEY_new_CMAC_key(NULL, key, sizeof(key), EVP_aes_256_ecb()); + pkey = EVP_PKEY_new_CMAC_key(NULL, key, sizeof(key), EVP_aes_256_cbc()); if (!TEST_ptr(pkey) || !TEST_true(get_cmac_val(pkey, mac2)) || !TEST_mem_eq(mac, sizeof(mac), mac2, sizeof(mac2))) |