aboutsummaryrefslogtreecommitdiff
path: root/apps/dgst.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2015-04-25 15:41:29 -0400
committerRich Salz <rsalz@openssl.org>2015-04-25 15:41:29 -0400
commit333b070ec06d7a67538ee9d5312656a19e802dc1 (patch)
treeaa630fe4f89d2333f82e2aeeba61f66e86e1349c /apps/dgst.c
parentc54cc2b15d96944fcf13ccd24baca79f9593cbf0 (diff)
downloadopenssl-333b070ec06d7a67538ee9d5312656a19e802dc1.zip
openssl-333b070ec06d7a67538ee9d5312656a19e802dc1.tar.gz
openssl-333b070ec06d7a67538ee9d5312656a19e802dc1.tar.bz2
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/dgst.c')
-rw-r--r--apps/dgst.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/apps/dgst.c b/apps/dgst.c
index 21b8c7f..adfa2a6 100644
--- a/apps/dgst.c
+++ b/apps/dgst.c
@@ -101,10 +101,6 @@ OPTIONS dgst_options[] = {
"Verify a signature using private key in file"},
{"signature", OPT_SIGNATURE, '<', "File with signature to verify"},
{"keyform", OPT_KEYFORM, 'f', "Key file format (PEM or ENGINE)"},
-#ifndef OPENSSL_NO_ENGINE
- {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
-#endif
- {"engine_impl", OPT_ENGINE_IMPL, '-'},
{"hex", OPT_HEX, '-', "Print as hex dump"},
{"binary", OPT_BINARY, '-', "Print in binary form"},
{"d", OPT_DEBUG, '-', "Print debug info"},
@@ -115,6 +111,10 @@ OPTIONS dgst_options[] = {
{"mac", OPT_MAC, 's', "Create MAC (not neccessarily HMAC)"},
{"sigop", OPT_SIGOPT, 's', "Signature parameter in n:v form"},
{"macop", OPT_MACOPT, 's', "MAC algorithm parameters in n:v form or key"},
+#ifndef OPENSSL_NO_ENGINE
+ {"engine", OPT_ENGINE, 's', "Use engine e, possibly a hardware device"},
+ {"engine_impl", OPT_ENGINE_IMPL, '-'},
+#endif
{"", OPT_DIGEST, '-', "Any supported digest"},
{NULL}
};
@@ -136,10 +136,7 @@ int dgst_main(int argc, char **argv)
int i, ret = 1, out_bin = -1, want_pub = 0, do_verify =
0, non_fips_allow = 0;
unsigned char *buf = NULL, *sigbuf = NULL;
-#ifndef OPENSSL_NO_ENGINE
- char *engine = NULL;
int engine_impl = 0;
-#endif
prog = opt_progname(argv[0]);
if ((buf = (unsigned char *)OPENSSL_malloc(BUFSIZE)) == NULL) {
@@ -193,15 +190,12 @@ int dgst_main(int argc, char **argv)
if (!opt_format(opt_arg(), OPT_FMT_ANY, &keyform))
goto opthelp;
break;
-#ifndef OPENSSL_NO_ENGINE
case OPT_ENGINE:
- engine = opt_arg();
- e = setup_engine(engine, 0);
+ e = setup_engine(opt_arg(), 0);
break;
case OPT_ENGINE_IMPL:
engine_impl = 1;
break;
-#endif
case OPT_HEX:
out_bin = 0;
break;
@@ -250,10 +244,8 @@ int dgst_main(int argc, char **argv)
"No signature to verify: use the -signature option\n");
goto end;
}
-#ifndef OPENSSL_NO_ENGINE
if (engine_impl)
impl = e;
-#endif
in = BIO_new(BIO_s_file());
bmd = BIO_new(BIO_f_md());