From: Dr. David von Oheimb Date: Fri, 20 May 2022 04:23:54 +0000 (+0200) Subject: apps/x509: Fix -CAfile option being neglected with -new or -in X-Git-Tag: openssl-3.2.0-alpha1~2393 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=10c7887330bb6ca136cd16fe081639f4462a072e;p=thirdparty%2Fopenssl.git apps/x509: Fix -CAfile option being neglected with -new or -in Reviewed-by: Tomas Mraz Reviewed-by: Paul Dale Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/18373) --- diff --git a/apps/x509.c b/apps/x509.c index 28558736041..182730be962 100644 --- a/apps/x509.c +++ b/apps/x509.c @@ -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;