diff options
author | Tomas Mraz <tomas@openssl.org> | 2023-09-12 18:54:55 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2023-09-13 13:17:12 +0200 |
commit | 094c9297fa7463024a7ca139d3f90b508f49fd91 (patch) | |
tree | be7f11cc8e95db46c16167b29fd082372c113855 | |
parent | d74ef8d89c408d419e41edb877e984d4052250c6 (diff) |
Revert "make inability to dup/clone ciphers an error"
This reverts commit d739b3e05e749d4310b7310c007a4f3b8d5f8556.
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22081)
-rw-r--r-- | test/evp_test.c | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/test/evp_test.c b/test/evp_test.c index ce72998b7c..280e19c0b8 100644 --- a/test/evp_test.c +++ b/test/evp_test.c @@ -709,9 +709,6 @@ static int cipher_test_enc(EVP_TEST *t, int enc, int ok = 0, tmplen, chunklen, tmpflen, i; EVP_CIPHER_CTX *ctx_base = NULL; EVP_CIPHER_CTX *ctx = NULL, *duped; - int fips_dupctx_supported = (fips_provider_version_ge(libctx, 3, 0, 11) - && fips_provider_version_lt(libctx, 3, 1, 0)) - || fips_provider_version_ge(libctx, 3, 1, 3); t->err = "TEST_FAILURE"; if (!TEST_ptr(ctx_base = EVP_CIPHER_CTX_new())) @@ -842,30 +839,18 @@ static int cipher_test_enc(EVP_TEST *t, int enc, /* Test that the cipher dup functions correctly if it is supported */ ERR_set_mark(); - if (!EVP_CIPHER_CTX_copy(ctx, ctx_base)) { - if (fips_dupctx_supported) { - TEST_info("Doing a copy of Cipher %s Fails!\n", - EVP_CIPHER_get0_name(expected->cipher)); - ERR_print_errors_fp(stderr); - goto err; - } else { - TEST_info("Allowing copy fail as an old fips provider is in use."); - } + if (EVP_CIPHER_CTX_copy(ctx, ctx_base)) { + EVP_CIPHER_CTX_free(ctx_base); + ctx_base = NULL; + } else { + EVP_CIPHER_CTX_free(ctx); + ctx = ctx_base; } /* Likewise for dup */ duped = EVP_CIPHER_CTX_dup(ctx); if (duped != NULL) { EVP_CIPHER_CTX_free(ctx); ctx = duped; - } else { - if (fips_dupctx_supported) { - TEST_info("Doing a dup of Cipher %s Fails!\n", - EVP_CIPHER_get0_name(expected->cipher)); - ERR_print_errors_fp(stderr); - goto err; - } else { - TEST_info("Allowing dup fail as an old fips provider is in use."); - } } ERR_pop_to_mark(); @@ -1050,7 +1035,6 @@ static int cipher_test_run(EVP_TEST *t) int rv, frag = 0; size_t out_misalign, inp_misalign; - TEST_info("RUNNING TEST FOR CIPHER %s\n", EVP_CIPHER_get0_name(cdat->cipher)); if (!cdat->key) { t->err = "NO_KEY"; return 0; |