CMP: fix gen_new() in cmp_msg.c checking wrong ITAVs

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19216)
This commit is contained in:
Dr. David von Oheimb 2022-09-17 20:58:16 +02:00 committed by Dr. David von Oheimb
parent 60ea150b1f
commit 7e3034939b

View File

@ -699,8 +699,7 @@ static OSSL_CMP_MSG *gen_new(OSSL_CMP_CTX *ctx,
if ((msg = ossl_cmp_msg_create(ctx, body_type)) == NULL)
return NULL;
if (ctx->genm_ITAVs != NULL
&& !ossl_cmp_msg_gen_push1_ITAVs(msg, itavs))
if (itavs != NULL && !ossl_cmp_msg_gen_push1_ITAVs(msg, itavs))
goto err;
if (!ossl_cmp_msg_protect(ctx, msg))