summaryrefslogtreecommitdiff
path: root/src/lib/libssl/src/apps/dsa.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/src/apps/dsa.c')
-rw-r--r--src/lib/libssl/src/apps/dsa.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/lib/libssl/src/apps/dsa.c b/src/lib/libssl/src/apps/dsa.c
index 9da1a41645..e9de3a3bdf 100644
--- a/src/lib/libssl/src/apps/dsa.c
+++ b/src/lib/libssl/src/apps/dsa.c
@@ -90,7 +90,9 @@ int MAIN(int, char **);
90 90
91int MAIN(int argc, char **argv) 91int MAIN(int argc, char **argv)
92 { 92 {
93#ifndef OPENSSL_NO_ENGINE
93 ENGINE *e = NULL; 94 ENGINE *e = NULL;
95#endif
94 int ret=1; 96 int ret=1;
95 DSA *dsa=NULL; 97 DSA *dsa=NULL;
96 int i,badops=0; 98 int i,badops=0;
@@ -98,7 +100,10 @@ int MAIN(int argc, char **argv)
98 BIO *in=NULL,*out=NULL; 100 BIO *in=NULL,*out=NULL;
99 int informat,outformat,text=0,noout=0; 101 int informat,outformat,text=0,noout=0;
100 int pubin = 0, pubout = 0; 102 int pubin = 0, pubout = 0;
101 char *infile,*outfile,*prog,*engine; 103 char *infile,*outfile,*prog;
104#ifndef OPENSSL_NO_ENGINE
105 char *engine;
106#endif
102 char *passargin = NULL, *passargout = NULL; 107 char *passargin = NULL, *passargout = NULL;
103 char *passin = NULL, *passout = NULL; 108 char *passin = NULL, *passout = NULL;
104 int modulus=0; 109 int modulus=0;
@@ -112,7 +117,9 @@ int MAIN(int argc, char **argv)
112 if (!load_config(bio_err, NULL)) 117 if (!load_config(bio_err, NULL))
113 goto end; 118 goto end;
114 119
120#ifndef OPENSSL_NO_ENGINE
115 engine=NULL; 121 engine=NULL;
122#endif
116 infile=NULL; 123 infile=NULL;
117 outfile=NULL; 124 outfile=NULL;
118 informat=FORMAT_PEM; 125 informat=FORMAT_PEM;
@@ -153,11 +160,13 @@ int MAIN(int argc, char **argv)
153 if (--argc < 1) goto bad; 160 if (--argc < 1) goto bad;
154 passargout= *(++argv); 161 passargout= *(++argv);
155 } 162 }
163#ifndef OPENSSL_NO_ENGINE
156 else if (strcmp(*argv,"-engine") == 0) 164 else if (strcmp(*argv,"-engine") == 0)
157 { 165 {
158 if (--argc < 1) goto bad; 166 if (--argc < 1) goto bad;
159 engine= *(++argv); 167 engine= *(++argv);
160 } 168 }
169#endif
161 else if (strcmp(*argv,"-noout") == 0) 170 else if (strcmp(*argv,"-noout") == 0)
162 noout=1; 171 noout=1;
163 else if (strcmp(*argv,"-text") == 0) 172 else if (strcmp(*argv,"-text") == 0)
@@ -189,7 +198,9 @@ bad:
189 BIO_printf(bio_err," -passin arg input file pass phrase source\n"); 198 BIO_printf(bio_err," -passin arg input file pass phrase source\n");
190 BIO_printf(bio_err," -out arg output file\n"); 199 BIO_printf(bio_err," -out arg output file\n");
191 BIO_printf(bio_err," -passout arg output file pass phrase source\n"); 200 BIO_printf(bio_err," -passout arg output file pass phrase source\n");
201#ifndef OPENSSL_NO_ENGINE
192 BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); 202 BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n");
203#endif
193 BIO_printf(bio_err," -des encrypt PEM output with cbc des\n"); 204 BIO_printf(bio_err," -des encrypt PEM output with cbc des\n");
194 BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n"); 205 BIO_printf(bio_err," -des3 encrypt PEM output with ede cbc des using 168 bit key\n");
195#ifndef OPENSSL_NO_IDEA 206#ifndef OPENSSL_NO_IDEA
@@ -207,7 +218,9 @@ bad:
207 218
208 ERR_load_crypto_strings(); 219 ERR_load_crypto_strings();
209 220
221#ifndef OPENSSL_NO_ENGINE
210 e = setup_engine(bio_err, engine, 0); 222 e = setup_engine(bio_err, engine, 0);
223#endif
211 224
212 if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) { 225 if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) {
213 BIO_printf(bio_err, "Error getting passwords\n"); 226 BIO_printf(bio_err, "Error getting passwords\n");
@@ -314,6 +327,6 @@ end:
314 if(passin) OPENSSL_free(passin); 327 if(passin) OPENSSL_free(passin);
315 if(passout) OPENSSL_free(passout); 328 if(passout) OPENSSL_free(passout);
316 apps_shutdown(); 329 apps_shutdown();
317 EXIT(ret); 330 OPENSSL_EXIT(ret);
318 } 331 }
319#endif 332#endif