summaryrefslogtreecommitdiffstats
path: root/test/acvp_test.c
diff options
context:
space:
mode:
authorslontis <shane.lontis@oracle.com>2024-08-19 05:52:24 +0200
committerTomas Mraz <tomas@openssl.org>2024-08-19 10:25:41 +0200
commit4c37778a4e8d59124b761a63a08ca0512b7067d2 (patch)
tree32ef635e074a2824e9565fedee48714603124bb2 /test/acvp_test.c
parentspeed.c: Return success with -testmode -async_jobs if not ASYNC_is_capable() (diff)
downloadopenssl-4c37778a4e8d59124b761a63a08ca0512b7067d2.tar.xz
openssl-4c37778a4e8d59124b761a63a08ca0512b7067d2.zip
CI: Fix GCM IV check in acvp_test for crosstest
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/25223)
Diffstat (limited to 'test/acvp_test.c')
-rw-r--r--test/acvp_test.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/test/acvp_test.c b/test/acvp_test.c
index 44f7249505..6ff7046d91 100644
--- a/test/acvp_test.c
+++ b/test/acvp_test.c
@@ -885,16 +885,21 @@ static int aes_gcm_enc_dec(const char *alg,
{
OSSL_PARAM params[] = { OSSL_PARAM_END, OSSL_PARAM_END, OSSL_PARAM_END };
+ OSSL_PARAM *p = params;
unsigned int iv_generated = -1;
+ const OSSL_PARAM *gettables = EVP_CIPHER_CTX_gettable_params(ctx);
+ const char *ivgenkey = OSSL_CIPHER_PARAM_AEAD_IV_GENERATED;
+ int ivgen = (OSSL_PARAM_locate_const(gettables, ivgenkey) != NULL);
- params[0] = OSSL_PARAM_construct_uint(OSSL_CIPHER_PARAM_AEAD_IV_GENERATED,
- &iv_generated);
+ if (ivgen != 0)
+ *p++ = OSSL_PARAM_construct_uint(ivgenkey, &iv_generated);
if (outiv != NULL)
- params[1] = OSSL_PARAM_construct_octet_string(OSSL_CIPHER_PARAM_IV,
- outiv, iv_len);
+ *p = OSSL_PARAM_construct_octet_string(OSSL_CIPHER_PARAM_IV,
+ outiv, iv_len);
if (!TEST_true(EVP_CIPHER_CTX_get_params(ctx, params)))
goto err;
- if (!TEST_uint_eq(iv_generated, (enc == 0 || iv != NULL ? 0 : 1)))
+ if (ivgen != 0
+ && !TEST_uint_eq(iv_generated, (enc == 0 || iv != NULL ? 0 : 1)))
goto err;
}
if (out_len != NULL)