summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/apps/gendsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/apps/gendsa.c')
-rw-r--r--src/lib/libssl/src/apps/gendsa.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/libssl/src/apps/gendsa.c b/src/lib/libssl/src/apps/gendsa.c
index 1e1e9f3e4c..6d2ed06c81 100644
--- a/src/lib/libssl/src/apps/gendsa.c
+++ b/src/lib/libssl/src/apps/gendsa.c
@@ -77,7 +77,9 @@ int MAIN(int, char **);
77 77
78int MAIN(int argc, char **argv) 78int MAIN(int argc, char **argv)
79 { 79 {
80#ifndef OPENSSL_NO_ENGINE
80 ENGINE *e = NULL; 81 ENGINE *e = NULL;
82#endif
81 DSA *dsa=NULL; 83 DSA *dsa=NULL;
82 int ret=1; 84 int ret=1;
83 char *outfile=NULL; 85 char *outfile=NULL;
@@ -85,7 +87,9 @@ int MAIN(int argc, char **argv)
85 char *passargout = NULL, *passout = NULL; 87 char *passargout = NULL, *passout = NULL;
86 BIO *out=NULL,*in=NULL; 88 BIO *out=NULL,*in=NULL;
87 const EVP_CIPHER *enc=NULL; 89 const EVP_CIPHER *enc=NULL;
90#ifndef OPENSSL_NO_ENGINE
88 char *engine=NULL; 91 char *engine=NULL;
92#endif
89 93
90 apps_startup(); 94 apps_startup();
91 95
@@ -111,11 +115,13 @@ int MAIN(int argc, char **argv)
111 if (--argc < 1) goto bad; 115 if (--argc < 1) goto bad;
112 passargout= *(++argv); 116 passargout= *(++argv);
113 } 117 }
118#ifndef OPENSSL_NO_ENGINE
114 else if (strcmp(*argv,"-engine") == 0) 119 else if (strcmp(*argv,"-engine") == 0)
115 { 120 {
116 if (--argc < 1) goto bad; 121 if (--argc < 1) goto bad;
117 engine= *(++argv); 122 engine= *(++argv);
118 } 123 }
124#endif
119 else if (strcmp(*argv,"-rand") == 0) 125 else if (strcmp(*argv,"-rand") == 0)
120 { 126 {
121 if (--argc < 1) goto bad; 127 if (--argc < 1) goto bad;
@@ -167,7 +173,9 @@ bad:
167 BIO_printf(bio_err," -aes128, -aes192, -aes256\n"); 173 BIO_printf(bio_err," -aes128, -aes192, -aes256\n");
168 BIO_printf(bio_err," encrypt PEM output with cbc aes\n"); 174 BIO_printf(bio_err," encrypt PEM output with cbc aes\n");
169#endif 175#endif
176#ifndef OPENSSL_NO_ENGINE
170 BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n"); 177 BIO_printf(bio_err," -engine e - use engine e, possibly a hardware device.\n");
178#endif
171 BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); 179 BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR);
172 BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); 180 BIO_printf(bio_err," - load the file (or the files in the directory) into\n");
173 BIO_printf(bio_err," the random number generator\n"); 181 BIO_printf(bio_err," the random number generator\n");
@@ -176,7 +184,9 @@ bad:
176 goto end; 184 goto end;
177 } 185 }
178 186
187#ifndef OPENSSL_NO_ENGINE
179 e = setup_engine(bio_err, engine, 0); 188 e = setup_engine(bio_err, engine, 0);
189#endif
180 190
181 if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) { 191 if(!app_passwd(bio_err, NULL, passargout, NULL, &passout)) {
182 BIO_printf(bio_err, "Error getting password\n"); 192 BIO_printf(bio_err, "Error getting password\n");
@@ -246,6 +256,6 @@ end:
246 if (dsa != NULL) DSA_free(dsa); 256 if (dsa != NULL) DSA_free(dsa);
247 if(passout) OPENSSL_free(passout); 257 if(passout) OPENSSL_free(passout);
248 apps_shutdown(); 258 apps_shutdown();
249 EXIT(ret); 259 OPENSSL_EXIT(ret);
250 } 260 }
251#endif 261#endif