summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Prindeville <philipp@redfish-solutions.com>2023-09-02 13:18:04 -0600
committerPauli <pauli@openssl.org>2023-09-06 09:46:05 +1000
commitc1673a60e40f6dcd110d1a4ff3e11a3297ada2da (patch)
tree010a9bdeb743505fe77ed4486b11626f68f4d077
parente664ef78b92532bf94c7976b181d88c4abf83074 (diff)
Per other commands, make progress dots in req only w/ -verbose
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)
-rw-r--r--apps/req.c13
-rw-r--r--doc/man1/openssl-req.pod.in7
2 files changed, 17 insertions, 3 deletions
diff --git a/apps/req.c b/apps/req.c
index 711bdff8bf..7ef51d4f0b 100644
--- a/apps/req.c
+++ b/apps/req.c
@@ -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);
diff --git a/doc/man1/openssl-req.pod.in b/doc/man1/openssl-req.pod.in
index 099582fa72..ad43dc2357 100644
--- a/doc/man1/openssl-req.pod.in
+++ b/doc/man1/openssl-req.pod.in
@@ -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