Skip to content

Commit

Permalink
test_CMAC_keygen(): Avoid using ECB cipher with CMAC
Browse files Browse the repository at this point in the history
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #19401)
  • Loading branch information
t8m committed Nov 11, 2022
1 parent 94976a1 commit a0783b8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/evp_extra_test.c
Expand Up @@ -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)
Expand All @@ -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)))
Expand Down

0 comments on commit a0783b8

Please sign in to comment.