Add -signcert to CA.pl usage message.
[openssl.git] / apps / CA.pl.in
index fbba457646bb73d030d54d577f79c9296c0ecb6e..4fc408896d16d6253042d9baed88c3b4f658645d 100644 (file)
@@ -1,4 +1,11 @@
 #!{- $config{perl} -}
+# Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
+#
+# Licensed under the OpenSSL license (the "License").  You may not use
+# this file except in compliance with the License.  You can obtain a copy
+# in the file LICENSE in the source distribution or at
+# https://www.openssl.org/source/license.html
+
 #
 # Wrapper around the ca to make it easier to use
 #
@@ -89,7 +96,7 @@ sub run
 
 
 if ( $WHAT =~ /^(-\?|-h|-help)$/ ) {
-    print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n";
+    print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n";
     print STDERR "       CA -pkcs12 [certname]\n";
     print STDERR "       CA -crl|-revoke cert-filename [reason]\n";
     exit 0;
@@ -120,9 +127,9 @@ if ($WHAT eq '-newcert' ) {
     close OUT;
     # ask user for existing CA certificate
     print "CA certificate filename (or enter to create)\n";
-    $FILE = <STDIN>;
-    $FILE = s|\R$|| if $FILE;
-    if ($FILE) {
+    $FILE = "" unless defined($FILE = <STDIN>);
+    $FILE =~ s{\R$}{};
+    if ($FILE ne "") {
         copy_pemfile($FILE,"${CATOP}/private/$CAKEY", "PRIVATE");
         copy_pemfile($FILE,"${CATOP}/$CACERT", "CERTIFICATE");
     } else {