]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ecdh_cofactor_derive_test(): Skip the test if the curve is not supported
authorTomas Mraz <tomas@openssl.org>
Fri, 18 Oct 2024 08:20:45 +0000 (10:20 +0200)
committerMatt Caswell <matt@openssl.org>
Mon, 21 Oct 2024 13:57:20 +0000 (14:57 +0100)
It will not be supported if the fips provider was built with no-ec2m.

Fixes #25729

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25731)

test/acvp_test.c

index 646b37884c4286212307caa2050cf575dab02ad6..944c8c0e485cbbf82aef5aedae3b2f0eeac7f067 100644 (file)
@@ -363,8 +363,10 @@ static int ecdh_cofactor_derive_test(int tstid)
     if (!ec_cofactors)
         return TEST_skip("not supported by FIPS provider version");
 
-    if (!TEST_ptr(peer1 = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve))
-            || !TEST_ptr(peer2 = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve)))
+    if (!TEST_ptr(peer1 = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve)))
+        return TEST_skip("Curve %s not supported by the FIPS provider", curve);
+
+    if (!TEST_ptr(peer2 = EVP_PKEY_Q_keygen(libctx, NULL, "EC", curve)))
         goto err;
 
     params[1] = OSSL_PARAM_construct_end();