| OLD | NEW |
| 1 /* apps/gendh.c */ | 1 /* apps/gendh.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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 #undef PROG | 82 #undef PROG |
| 83 #define PROG gendh_main | 83 #define PROG gendh_main |
| 84 | 84 |
| 85 static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); | 85 static int MS_CALLBACK dh_cb(int p, int n, BN_GENCB *cb); |
| 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 BN_GENCB cb; | 91 BN_GENCB cb; |
| 92 #ifndef OPENSSL_NO_ENGINE | |
| 93 ENGINE *e = NULL; | |
| 94 #endif | |
| 95 DH *dh=NULL; | 92 DH *dh=NULL; |
| 96 int ret=1,num=DEFBITS; | 93 int ret=1,num=DEFBITS; |
| 97 int g=2; | 94 int g=2; |
| 98 char *outfile=NULL; | 95 char *outfile=NULL; |
| 99 char *inrand=NULL; | 96 char *inrand=NULL; |
| 100 #ifndef OPENSSL_NO_ENGINE | 97 #ifndef OPENSSL_NO_ENGINE |
| 101 char *engine=NULL; | 98 char *engine=NULL; |
| 102 #endif | 99 #endif |
| 103 BIO *out=NULL; | 100 BIO *out=NULL; |
| 104 | 101 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 #ifndef OPENSSL_NO_ENGINE | 153 #ifndef OPENSSL_NO_ENGINE |
| 157 BIO_printf(bio_err," -engine e - use engine e, possibly a hardwa
re device.\n"); | 154 BIO_printf(bio_err," -engine e - use engine e, possibly a hardwa
re device.\n"); |
| 158 #endif | 155 #endif |
| 159 BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CH
AR, LIST_SEPARATOR_CHAR); | 156 BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CH
AR, LIST_SEPARATOR_CHAR); |
| 160 BIO_printf(bio_err," - load the file (or the files in
the directory) into\n"); | 157 BIO_printf(bio_err," - load the file (or the files in
the directory) into\n"); |
| 161 BIO_printf(bio_err," the random number generator\n")
; | 158 BIO_printf(bio_err," the random number generator\n")
; |
| 162 goto end; | 159 goto end; |
| 163 } | 160 } |
| 164 | 161 |
| 165 #ifndef OPENSSL_NO_ENGINE | 162 #ifndef OPENSSL_NO_ENGINE |
| 166 e = setup_engine(bio_err, engine, 0); | 163 setup_engine(bio_err, engine, 0); |
| 167 #endif | 164 #endif |
| 168 | 165 |
| 169 out=BIO_new(BIO_s_file()); | 166 out=BIO_new(BIO_s_file()); |
| 170 if (out == NULL) | 167 if (out == NULL) |
| 171 { | 168 { |
| 172 ERR_print_errors(bio_err); | 169 ERR_print_errors(bio_err); |
| 173 goto end; | 170 goto end; |
| 174 } | 171 } |
| 175 | 172 |
| 176 if (outfile == NULL) | 173 if (outfile == NULL) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 if (p == 1) c='+'; | 225 if (p == 1) c='+'; |
| 229 if (p == 2) c='*'; | 226 if (p == 2) c='*'; |
| 230 if (p == 3) c='\n'; | 227 if (p == 3) c='\n'; |
| 231 BIO_write(cb->arg,&c,1); | 228 BIO_write(cb->arg,&c,1); |
| 232 (void)BIO_flush(cb->arg); | 229 (void)BIO_flush(cb->arg); |
| 233 #ifdef LINT | 230 #ifdef LINT |
| 234 p=n; | 231 p=n; |
| 235 #endif | 232 #endif |
| 236 return 1; | 233 return 1; |
| 237 } | 234 } |
| 235 #else /* !OPENSSL_NO_DH */ |
| 236 |
| 237 # if PEDANTIC |
| 238 static void *dummy=&dummy; |
| 239 # endif |
| 240 |
| 238 #endif | 241 #endif |
| OLD | NEW |