diff options
author | Rich Salz <rsalz@openssl.org> | 2015-04-25 15:41:29 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-04-25 15:41:29 -0400 |
commit | 333b070ec06d7a67538ee9d5312656a19e802dc1 (patch) | |
tree | aa630fe4f89d2333f82e2aeeba61f66e86e1349c /apps/req.c | |
parent | c54cc2b15d96944fcf13ccd24baca79f9593cbf0 (diff) |
fewer NO_ENGINE #ifdef's
Make setup_engine be a dummy if NO_ENGINE is enabled.
The option is not enabled if NO_ENGINE is enabled, so the one "wasted"
variable just sits there. Removes some variables and code.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/apps/req.c b/apps/req.c index 1237c33ec1..0502a64abf 100644 --- a/apps/req.c +++ b/apps/req.c @@ -136,7 +136,6 @@ OPTIONS req_options[] = { {"outform", OPT_OUTFORM, 'F', "Output format - DER or PEM"}, {"in", OPT_IN, '<', "Input file"}, {"out", OPT_OUT, '>', "Output file"}, - {"keygen_engine", OPT_KEYGEN_ENGINE, 's'}, {"key", OPT_KEY, '<', "Use the private key contained in file"}, {"keyform", OPT_KEYFORM, 'F', "Key file format"}, {"pubkey", OPT_PUBKEY, '-', "Output public key"}, @@ -179,6 +178,7 @@ OPTIONS req_options[] = { "Request extension section (override value in config file)"}, #ifndef OPENSSL_NO_ENGINE {"engine", OPT_ENGINE, 's', "Use engine, possibly a hardware device"}, + {"keygen_engine", OPT_KEYGEN_ENGINE, 's'}, #endif {"", OPT_MD, '-', "Any supported digest"}, {NULL} @@ -196,7 +196,7 @@ int req_main(int argc, char **argv) X509_REQ *req = NULL; const EVP_CIPHER *cipher = NULL; const EVP_MD *md_alg = NULL, *digest = NULL; - char *engine = NULL, *extensions = NULL, *infile = NULL; + char *extensions = NULL, *infile = NULL; char *outfile = NULL, *keyfile = NULL, *inrand = NULL; char *keyalgstr = NULL, *p, *prog, *passargin = NULL, *passargout = NULL; char *passin = NULL, *passout = NULL, *req_exts = NULL, *subj = NULL; @@ -235,18 +235,18 @@ int req_main(int argc, char **argv) if (!opt_format(opt_arg(), OPT_FMT_PEMDER, &outformat)) goto opthelp; break; -#ifndef OPENSSL_NO_ENGINE case OPT_ENGINE: - engine = optarg; + (void)setup_engine(opt_arg(), 0); break; case OPT_KEYGEN_ENGINE: +#ifndef OPENSSL_NO_ENGINE gen_eng = ENGINE_by_id(opt_arg()); if (gen_eng == NULL) { BIO_printf(bio_err, "Can't find keygen engine %s\n", *argv); - goto end; + goto opthelp; } - break; #endif + break; case OPT_KEY: keyfile = opt_arg(); break; @@ -498,9 +498,6 @@ int req_main(int argc, char **argv) goto end; } } -#ifndef OPENSSL_NO_ENGINE - e = setup_engine(engine, 0); -#endif if (keyfile != NULL) { pkey = load_key(keyfile, keyform, 0, passin, e, "Private Key"); |