From 10c7887330bb6ca136cd16fe081639f4462a072e Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Fri, 20 May 2022 06:23:54 +0200 Subject: [PATCH] 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) --- apps/x509.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3