]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
evp_libctx_test: fix provider compat CI regression
authorPauli <ppzgs1@gmail.com>
Mon, 7 Oct 2024 23:38:26 +0000 (10:38 +1100)
committerTomas Mraz <tomas@openssl.org>
Tue, 8 Oct 2024 07:28:32 +0000 (09:28 +0200)
The regression was introduced by #25522.

Fixes #25632

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25633)

test/evp_libctx_test.c

index 784e4a58b01e6266ee8e1cd59ec0a9cc0cdae10b..7e246efd800a845b07efcdfd3f64a0de861c68d2 100644 (file)
@@ -604,14 +604,16 @@ static int kem_rsa_gen_recover(void)
           && TEST_mem_eq(unwrap, unwraplen, secret, secretlen);
 
     /* Test that providing a too short unwrapped/ctlen fails */
-    ctlen = 1;
-    if (!TEST_int_eq(EVP_PKEY_encapsulate(dctx, ct, &ctlen, secret,
-                                          &secretlen), 0))
-        ret = 0;
-    unwraplen = 1;
-    if (!TEST_int_eq(EVP_PKEY_decapsulate(rctx, unwrap, &unwraplen, ct,
-                                          ctlen), 0))
-        ret = 0;
+    if (fips_provider_version_match(libctx, ">=3.4.0")) {
+        ctlen = 1;
+        if (!TEST_int_eq(EVP_PKEY_encapsulate(dctx, ct, &ctlen, secret,
+                                              &secretlen), 0))
+            ret = 0;
+        unwraplen = 1;
+        if (!TEST_int_eq(EVP_PKEY_decapsulate(rctx, unwrap, &unwraplen, ct,
+                                              ctlen), 0))
+            ret = 0;
+    }
 
     EVP_PKEY_free(pub);
     EVP_PKEY_free(priv);