evp_libctx_test: fix provider compat CI regression

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)
This commit is contained in:
Pauli 2024-10-08 10:38:26 +11:00 committed by Tomas Mraz
parent 0a2a8d970f
commit 73e720c3a5

View 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);