Skip to content

Commit

Permalink
evp_libctx_test: fix provider compat CI regression
Browse files Browse the repository at this point in the history
The regression was introduced by openssl#25522.

Fixes openssl#25632

Reviewed-by: Neil Horman <[email protected]>
Reviewed-by: Shane Lontis <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#25633)

(cherry picked from commit 73e720c)
  • Loading branch information
paulidale authored and t8m committed Oct 8, 2024
1 parent cb28637 commit dfbd287
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/evp_libctx_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,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);
Expand Down

0 comments on commit dfbd287

Please sign in to comment.