apps/x509: Fix -CAfile option being neglected with -new or -in

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18373)
This commit is contained in:
Dr. David von Oheimb 2022-05-20 06:23:54 +02:00 committed by Hugo Landau
parent f95fec2938
commit 10c7887330
1 changed files with 1 additions and 1 deletions

View File

@ -730,7 +730,7 @@ int x509_main(int argc, char **argv)
}
if ((x = X509_new_ex(app_get0_libctx(), app_get0_propq())) == NULL)
goto end;
if (sno == NULL) {
if (CAfile == NULL && sno == NULL) {
sno = ASN1_INTEGER_new();
if (sno == NULL || !rand_serial(NULL, sno))
goto end;