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)
This commit is contained in:
Philip Prindeville 2023-09-02 13:18:04 -06:00 committed by Pauli
parent e664ef78b9
commit c1673a60e4
2 changed files with 17 additions and 3 deletions

View 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);

View 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