Fix regression in evp_test for provider compat CI
authorNeil Horman <nhorman@openssl.org>
Tue, 12 Sep 2023 21:07:53 +0000 (17:07 -0400)
committerPauli <pauli@openssl.org>
Sun, 17 Sep 2023 11:02:58 +0000 (21:02 +1000)
If we ignore the faliure to copy on an old fips provider, we need to use
ctx_base, rather than ctx

Fixes #22076

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22102)

test/evp_test.c

index 7447435f06045b8159e2f5d04eec1bf30ad34c59..f15b2c5a1732c70d24df453d0b614656f3058740 100644 (file)
@@ -877,6 +877,11 @@ static int cipher_test_enc(EVP_TEST *t, int enc, size_t out_misalign,
         } else {
             TEST_info("Allowing copy fail as an old fips provider is in use.");
         }
+        EVP_CIPHER_CTX_free(ctx);
+        ctx = ctx_base;
+    } else {
+        EVP_CIPHER_CTX_free(ctx_base);
+        ctx_base = NULL;
     }
     /* Likewise for dup */
     duped = EVP_CIPHER_CTX_dup(ctx);