]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Remove DAYS argument
authorMalcolm Hogan <rickandmorty850@gmail.com>
Fri, 7 Mar 2025 23:30:43 +0000 (18:30 -0500)
committerMatt Caswell <matt@openssl.org>
Tue, 15 Apr 2025 14:22:54 +0000 (15:22 +0100)
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 <tomas@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
(Merged from https://github.com/openssl/openssl/pull/27277)

apps/CA.pl.in

index 2c31ee6c8de13afb838b33dab6e8f8e6244bd231..2fcc8268567fdf549aa703bb12546186b2755231 100644 (file)
@@ -143,7 +143,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