Skip to content

Commit 8cca7cb

Browse files
committed
test_cipher_reinit(): Reinit is not supported with CCM on old providers
1 parent 0673930 commit 8cca7cb

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

‎test/evp_libctx_test.c‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,13 +377,19 @@ static int test_cipher_reinit(int test_id)
377377
};
378378
const char *name = sk_OPENSSL_STRING_value(cipher_names, test_id);
379379

380-
if (!TEST_ptr(ctx = EVP_CIPHER_CTX_new()))
381-
goto err;
382-
383380
TEST_note("Fetching %s\n", name);
384381
if (!TEST_ptr(cipher = EVP_CIPHER_fetch(libctx, name, NULL)))
385382
goto err;
386383

384+
if (fips_provider_version_match(libctx, "<4.2.0")
385+
&& EVP_CIPHER_get_mode(cipher) == EVP_CIPH_CCM_MODE) {
386+
EVP_CIPHER_free(cipher);
387+
return TEST_skip("CCM modes do not support reinit with old providers");
388+
}
389+
390+
if (!TEST_ptr(ctx = EVP_CIPHER_CTX_new()))
391+
goto err;
392+
387393
/* siv cannot be called with NULL key as the iv is irrelevant */
388394
siv = (EVP_CIPHER_get_mode(cipher) == EVP_CIPH_SIV_MODE);
389395

0 commit comments

Comments
 (0)