]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Per other commands, make progress dots in req only w/ -verbose
authorPhilip Prindeville <philipp@redfish-solutions.com>
Sat, 2 Sep 2023 19:18:04 +0000 (13:18 -0600)
committerPauli <pauli@openssl.org>
Tue, 5 Sep 2023 23:46:05 +0000 (09:46 +1000)
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21937)

apps/req.c
doc/man1/openssl-req.pod.in

index 711bdff8bfe159b0547309cbfecf9be2b6604bd8..7ef51d4f0b7550ce26c3a5a74076c972cc7ad340 100644 (file)
@@ -90,7 +90,7 @@ typedef enum OPTION_choice {
     OPT_MULTIVALUE_RDN, OPT_DAYS, OPT_SET_SERIAL,
     OPT_COPY_EXTENSIONS, OPT_EXTENSIONS, OPT_REQEXTS, OPT_ADDEXT,
     OPT_PRECERT, OPT_MD,
-    OPT_SECTION,
+    OPT_SECTION, OPT_QUIET,
     OPT_R_ENUM, OPT_PROV_ENUM
 } OPTION_CHOICE;
 
@@ -158,6 +158,7 @@ const OPTIONS req_options[] = {
     {"batch", OPT_BATCH, '-',
      "Do not ask anything during request generation"},
     {"verbose", OPT_VERBOSE, '-', "Verbose output"},
+    {"quiet", OPT_QUIET, '-', "Terse output"},
     {"noenc", OPT_NOENC, '-', "Don't encrypt private keys"},
     {"nodes", OPT_NODES, '-', "Don't encrypt private keys; deprecated"},
     {"noout", OPT_NOOUT, '-', "Do not output REQ"},
@@ -259,7 +260,7 @@ int req_main(int argc, char **argv)
     const char *keyalg = NULL;
     OPTION_CHOICE o;
     int days = UNSET_DAYS;
-    int ret = 1, gen_x509 = 0, i = 0, newreq = 0, verbose = 0;
+    int ret = 1, gen_x509 = 0, i = 0, newreq = 0, verbose = 0, progress = 1;
     int informat = FORMAT_UNDEF, outformat = FORMAT_PEM, keyform = FORMAT_UNDEF;
     int modulus = 0, multirdn = 1, verify = 0, noout = 0, text = 0;
     int noenc = 0, newhdr = 0, subject = 0, pubkey = 0, precert = 0, x509v1 = 0;
@@ -389,6 +390,11 @@ int req_main(int argc, char **argv)
             break;
         case OPT_VERBOSE:
             verbose = 1;
+            progress = 1;
+            break;
+        case OPT_QUIET:
+            verbose = 0;
+            progress = 0;
             break;
         case OPT_UTF8:
             chtype = MBSTRING_UTF8;
@@ -652,8 +658,9 @@ int req_main(int argc, char **argv)
             }
         }
 
-        EVP_PKEY_CTX_set_cb(genctx, progress_cb);
         EVP_PKEY_CTX_set_app_data(genctx, bio_err);
+        if (progress)
+            EVP_PKEY_CTX_set_cb(genctx, progress_cb);
 
         pkey = app_keygen(genctx, keyalgstr, newkey_len, verbose);
 
index 099582fa7261217f7337b622ca0944ce8792fba2..ad43dc23577927a6e6c646c1c3e2794a87018bfc 100644 (file)
@@ -53,6 +53,7 @@ B<openssl> B<req>
 [B<-vfyopt> I<nm>:I<v>]
 [B<-batch>]
 [B<-verbose>]
+[B<-quiet>]
 {- $OpenSSL::safe::opt_name_synopsis -}
 {- $OpenSSL::safe::opt_r_synopsis -}
 {- $OpenSSL::safe::opt_engine_synopsis -}{- $OpenSSL::safe::opt_provider_synopsis -}
@@ -402,6 +403,12 @@ Non-interactive mode.
 
 Print extra details about the operations being performed.
 
+=item B<-quiet>
+
+Print fewer details about the operations being performed, which may be
+handy during batch scripts or pipelines (specifically "progress dots"
+during key generation are suppressed).
+
 =item B<-keygen_engine> I<id>
 
 Specifies an engine (by its unique I<id> string) which would be used