From: Malcolm Hogan Date: Fri, 7 Mar 2025 23:30:43 +0000 (-0500) Subject: Remove DAYS argument X-Git-Tag: openssl-3.0.17~70 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d125be7d4c19ec9b25e33ba7de2ec722a0e9abd;p=thirdparty%2Fopenssl.git Remove DAYS argument This commit removes DAYS from certificate requests to avoid the warning 'Ignoring -days without -x509; not generating a certificate' This argument is not needed with the -new argument. Additionally makes sure $1 is handled when -nodes is not given. Preventing an uninitialized value error when the DAYS argument is removed. Fixes #26595 CLA: trivial Reviewed-by: Tomas Mraz Reviewed-by: Tom Cosgrove (Merged from https://github.com/openssl/openssl/pull/27277) (cherry picked from commit d890ad2b96efea4f5f4b0db190017ce9a3897df7) --- diff --git a/apps/CA.pl.in b/apps/CA.pl.in index f029470005d..546c4ce35bb 100644 --- a/apps/CA.pl.in +++ b/apps/CA.pl.in @@ -141,7 +141,7 @@ if ($WHAT eq '-newcert' ) { print "Pre-cert is in $NEWCERT, private key is in $NEWKEY\n" if $RET == 0; } elsif ($WHAT =~ /^\-newreq(\-nodes)?$/ ) { # create a certificate request - $RET = run("$REQ -new $1 -keyout $NEWKEY -out $NEWREQ $DAYS $EXTRA{req}"); + $RET = run("$REQ -new" . (defined $1 ? " $1" : "") . " -keyout $NEWKEY -out $NEWREQ $EXTRA{req}"); print "Request is in $NEWREQ, private key is in $NEWKEY\n" if $RET == 0; } elsif ($WHAT eq '-newca' ) { # create the directory hierarchy