diff options
Diffstat (limited to 'src/lib/libssl/src/apps/gendsa.c')
-rw-r--r-- | src/lib/libssl/src/apps/gendsa.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/src/lib/libssl/src/apps/gendsa.c b/src/lib/libssl/src/apps/gendsa.c index c4e5415cdc..2042f69f68 100644 --- a/src/lib/libssl/src/apps/gendsa.c +++ b/src/lib/libssl/src/apps/gendsa.c | |||
@@ -56,7 +56,7 @@ | |||
56 | * [including the GNU Public Licence.] | 56 | * [including the GNU Public Licence.] |
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <openssl/opensslconf.h> /* for OPENSSL_NO_DSA */ | 59 | #include <openssl/opensslconf.h>/* for OPENSSL_NO_DSA */ |
60 | #ifndef OPENSSL_NO_DSA | 60 | #ifndef OPENSSL_NO_DSA |
61 | #include <stdio.h> | 61 | #include <stdio.h> |
62 | #include <string.h> | 62 | #include <string.h> |
@@ -94,7 +94,7 @@ MAIN(int argc, char **argv) | |||
94 | 94 | ||
95 | if (bio_err == NULL) | 95 | if (bio_err == NULL) |
96 | if ((bio_err = BIO_new(BIO_s_file())) != NULL) | 96 | if ((bio_err = BIO_new(BIO_s_file())) != NULL) |
97 | BIO_set_fp(bio_err, stderr, BIO_NOCLOSE|BIO_FP_TEXT); | 97 | BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT); |
98 | 98 | ||
99 | if (!load_config(bio_err, NULL)) | 99 | if (!load_config(bio_err, NULL)) |
100 | goto end; | 100 | goto end; |
@@ -107,23 +107,23 @@ MAIN(int argc, char **argv) | |||
107 | if (strcmp(*argv, "-out") == 0) { | 107 | if (strcmp(*argv, "-out") == 0) { |
108 | if (--argc < 1) | 108 | if (--argc < 1) |
109 | goto bad; | 109 | goto bad; |
110 | outfile= *(++argv); | 110 | outfile = *(++argv); |
111 | } else if (strcmp(*argv, "-passout") == 0) { | 111 | } else if (strcmp(*argv, "-passout") == 0) { |
112 | if (--argc < 1) | 112 | if (--argc < 1) |
113 | goto bad; | 113 | goto bad; |
114 | passargout= *(++argv); | 114 | passargout = *(++argv); |
115 | } | 115 | } |
116 | #ifndef OPENSSL_NO_ENGINE | 116 | #ifndef OPENSSL_NO_ENGINE |
117 | else if (strcmp(*argv, "-engine") == 0) { | 117 | else if (strcmp(*argv, "-engine") == 0) { |
118 | if (--argc < 1) | 118 | if (--argc < 1) |
119 | goto bad; | 119 | goto bad; |
120 | engine= *(++argv); | 120 | engine = *(++argv); |
121 | } | 121 | } |
122 | #endif | 122 | #endif |
123 | else if (strcmp(*argv, "-rand") == 0) { | 123 | else if (strcmp(*argv, "-rand") == 0) { |
124 | if (--argc < 1) | 124 | if (--argc < 1) |
125 | goto bad; | 125 | goto bad; |
126 | inrand= *(++argv); | 126 | inrand = *(++argv); |
127 | } else if (strcmp(*argv, "-") == 0) | 127 | } else if (strcmp(*argv, "-") == 0) |
128 | goto bad; | 128 | goto bad; |
129 | #ifndef OPENSSL_NO_DES | 129 | #ifndef OPENSSL_NO_DES |
@@ -197,7 +197,6 @@ bad: | |||
197 | BIO_printf(bio_err, " - a DSA parameter file as generated by the dsaparam command\n"); | 197 | BIO_printf(bio_err, " - a DSA parameter file as generated by the dsaparam command\n"); |
198 | goto end; | 198 | goto end; |
199 | } | 199 | } |
200 | |||
201 | #ifndef OPENSSL_NO_ENGINE | 200 | #ifndef OPENSSL_NO_ENGINE |
202 | setup_engine(bio_err, engine, 0); | 201 | setup_engine(bio_err, engine, 0); |
203 | #endif | 202 | #endif |
@@ -206,14 +205,11 @@ bad: | |||
206 | BIO_printf(bio_err, "Error getting password\n"); | 205 | BIO_printf(bio_err, "Error getting password\n"); |
207 | goto end; | 206 | goto end; |
208 | } | 207 | } |
209 | |||
210 | |||
211 | in = BIO_new(BIO_s_file()); | 208 | in = BIO_new(BIO_s_file()); |
212 | if (!(BIO_read_filename(in, dsaparams))) { | 209 | if (!(BIO_read_filename(in, dsaparams))) { |
213 | perror(dsaparams); | 210 | perror(dsaparams); |
214 | goto end; | 211 | goto end; |
215 | } | 212 | } |
216 | |||
217 | if ((dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL)) == NULL) { | 213 | if ((dsa = PEM_read_bio_DSAparams(in, NULL, NULL, NULL)) == NULL) { |
218 | BIO_printf(bio_err, "unable to load DSA parameter file\n"); | 214 | BIO_printf(bio_err, "unable to load DSA parameter file\n"); |
219 | goto end; | 215 | goto end; |
@@ -263,12 +259,12 @@ end: | |||
263 | if (passout) | 259 | if (passout) |
264 | free(passout); | 260 | free(passout); |
265 | apps_shutdown(); | 261 | apps_shutdown(); |
266 | return(ret); | 262 | return (ret); |
267 | } | 263 | } |
268 | #else /* !OPENSSL_NO_DSA */ | 264 | #else /* !OPENSSL_NO_DSA */ |
269 | 265 | ||
270 | # if PEDANTIC | 266 | #if PEDANTIC |
271 | static void *dummy = &dummy; | 267 | static void *dummy = &dummy; |
272 | # endif | 268 | #endif |
273 | 269 | ||
274 | #endif | 270 | #endif |