summaryrefslogtreecommitdiffstats
path: root/apps/genrsa.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/genrsa.c
parentc54cc2b15d96944fcf13ccd24baca79f9593cbf0 (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/genrsa.c')
-rw-r--r--apps/genrsa.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/apps/genrsa.c b/apps/genrsa.c
index b7275aef7a..7d0466aaf9 100644
--- a/apps/genrsa.c
+++ b/apps/genrsa.c
@@ -110,8 +110,7 @@ int genrsa_main(int argc, char **argv)
int ret = 1, non_fips_allow = 0, num = DEFBITS;
unsigned long f4 = RSA_F4;
char *outfile = NULL, *passoutarg = NULL, *passout = NULL;
- char *engine = NULL, *inrand = NULL, *prog;
- char *hexe, *dece;
+ char *inrand = NULL, *prog, *hexe, *dece;
OPTION_CHOICE o;
if (!bn || !cb)
@@ -142,7 +141,7 @@ int genrsa_main(int argc, char **argv)
case OPT_OUT:
outfile = opt_arg();
case OPT_ENGINE:
- engine = opt_arg();
+ e = setup_engine(opt_arg(), 0);
break;
case OPT_RAND:
inrand = opt_arg();
@@ -166,9 +165,6 @@ int genrsa_main(int argc, char **argv)
BIO_printf(bio_err, "Error getting password\n");
goto end;
}
-# ifndef OPENSSL_NO_ENGINE
- e = setup_engine(engine, 0);
-# endif
out = bio_open_default(outfile, "w");
if (out == NULL)
@@ -185,11 +181,7 @@ int genrsa_main(int argc, char **argv)
BIO_printf(bio_err, "Generating RSA private key, %d bit long modulus\n",
num);
-# ifdef OPENSSL_NO_ENGINE
- rsa = RSA_new();
-# else
- rsa = RSA_new_method(e);
-# endif
+ rsa = e ? RSA_new_method(e) : RSA_new();
if (!rsa)
goto end;