| OLD | NEW |
| 1 /* apps/dh.c */ | 1 /* apps/dh.c */ |
| 2 /* obsoleted by dhparam.c */ | 2 /* obsoleted by dhparam.c */ |
| 3 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 3 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
| 4 * All rights reserved. | 4 * All rights reserved. |
| 5 * | 5 * |
| 6 * This package is an SSL implementation written | 6 * This package is an SSL implementation written |
| 7 * by Eric Young (eay@cryptsoft.com). | 7 * by Eric Young (eay@cryptsoft.com). |
| 8 * The implementation was written so as to conform with Netscapes SSL. | 8 * The implementation was written so as to conform with Netscapes SSL. |
| 9 * | 9 * |
| 10 * This library is free for commercial and non-commercial use as long as | 10 * This library is free for commercial and non-commercial use as long as |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 * -check - check the parameters are ok | 81 * -check - check the parameters are ok |
| 82 * -noout | 82 * -noout |
| 83 * -text | 83 * -text |
| 84 * -C | 84 * -C |
| 85 */ | 85 */ |
| 86 | 86 |
| 87 int MAIN(int, char **); | 87 int MAIN(int, char **); |
| 88 | 88 |
| 89 int MAIN(int argc, char **argv) | 89 int MAIN(int argc, char **argv) |
| 90 { | 90 { |
| 91 #ifndef OPENSSL_NO_ENGINE | |
| 92 ENGINE *e = NULL; | |
| 93 #endif | |
| 94 DH *dh=NULL; | 91 DH *dh=NULL; |
| 95 int i,badops=0,text=0; | 92 int i,badops=0,text=0; |
| 96 BIO *in=NULL,*out=NULL; | 93 BIO *in=NULL,*out=NULL; |
| 97 int informat,outformat,check=0,noout=0,C=0,ret=1; | 94 int informat,outformat,check=0,noout=0,C=0,ret=1; |
| 98 char *infile,*outfile,*prog; | 95 char *infile,*outfile,*prog; |
| 99 #ifndef OPENSSL_NO_ENGINE | 96 #ifndef OPENSSL_NO_ENGINE |
| 100 char *engine; | 97 char *engine; |
| 101 #endif | 98 #endif |
| 102 | 99 |
| 103 apps_startup(); | 100 apps_startup(); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 BIO_printf(bio_err," -noout no output\n"); | 179 BIO_printf(bio_err," -noout no output\n"); |
| 183 #ifndef OPENSSL_NO_ENGINE | 180 #ifndef OPENSSL_NO_ENGINE |
| 184 BIO_printf(bio_err," -engine e use engine e, possibly a hard
ware device.\n"); | 181 BIO_printf(bio_err," -engine e use engine e, possibly a hard
ware device.\n"); |
| 185 #endif | 182 #endif |
| 186 goto end; | 183 goto end; |
| 187 } | 184 } |
| 188 | 185 |
| 189 ERR_load_crypto_strings(); | 186 ERR_load_crypto_strings(); |
| 190 | 187 |
| 191 #ifndef OPENSSL_NO_ENGINE | 188 #ifndef OPENSSL_NO_ENGINE |
| 192 e = setup_engine(bio_err, engine, 0); | 189 setup_engine(bio_err, engine, 0); |
| 193 #endif | 190 #endif |
| 194 | 191 |
| 195 in=BIO_new(BIO_s_file()); | 192 in=BIO_new(BIO_s_file()); |
| 196 out=BIO_new(BIO_s_file()); | 193 out=BIO_new(BIO_s_file()); |
| 197 if ((in == NULL) || (out == NULL)) | 194 if ((in == NULL) || (out == NULL)) |
| 198 { | 195 { |
| 199 ERR_print_errors(bio_err); | 196 ERR_print_errors(bio_err); |
| 200 goto end; | 197 goto end; |
| 201 } | 198 } |
| 202 | 199 |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 } | 339 } |
| 343 } | 340 } |
| 344 ret=0; | 341 ret=0; |
| 345 end: | 342 end: |
| 346 if (in != NULL) BIO_free(in); | 343 if (in != NULL) BIO_free(in); |
| 347 if (out != NULL) BIO_free_all(out); | 344 if (out != NULL) BIO_free_all(out); |
| 348 if (dh != NULL) DH_free(dh); | 345 if (dh != NULL) DH_free(dh); |
| 349 apps_shutdown(); | 346 apps_shutdown(); |
| 350 OPENSSL_EXIT(ret); | 347 OPENSSL_EXIT(ret); |
| 351 } | 348 } |
| 349 #else /* !OPENSSL_NO_DH */ |
| 350 |
| 351 # if PEDANTIC |
| 352 static void *dummy=&dummy; |
| 353 # endif |
| 354 |
| 352 #endif | 355 #endif |
| OLD | NEW |