CMP: prevent misleading PKIStatusInfo output if not response available

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13409)
This commit is contained in:
Dr. David von Oheimb 2020-11-13 21:32:31 +01:00
parent 6fd8313589
commit 8c5c2fa544
2 changed files with 3 additions and 0 deletions

View File

@ -2870,6 +2870,8 @@ int cmp_main(int argc, char **argv)
default:
break;
}
if (OSSL_CMP_CTX_get_status(cmp_ctx) < 0)
goto err; /* we got no response, maybe even did not send request */
{
/* print PKIStatusInfo */

View File

@ -886,6 +886,7 @@ STACK_OF(OSSL_CMP_ITAV) *OSSL_CMP_exec_GENM_ses(OSSL_CMP_CTX *ctx)
ERR_raise(ERR_LIB_CMP, CMP_R_INVALID_ARGS);
return 0;
}
ctx->status = -1;
if ((genm = ossl_cmp_genm_new(ctx)) == NULL)
goto err;