dsa.c (1.1.1.4) | dsa.c (1.1.1.5) |
---|---|
1/* apps/dsa.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 92 unchanged lines hidden (view full) --- 101 int ret = 1; 102 DSA *dsa = NULL; 103 int i, badops = 0; 104 const EVP_CIPHER *enc = NULL; 105 BIO *in = NULL, *out = NULL; 106 int informat, outformat, text = 0, noout = 0; 107 int pubin = 0, pubout = 0; 108 char *infile, *outfile, *prog; | 1/* apps/dsa.c */ 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 3 * All rights reserved. 4 * 5 * This package is an SSL implementation written 6 * by Eric Young (eay@cryptsoft.com). 7 * The implementation was written so as to conform with Netscapes SSL. 8 * --- 92 unchanged lines hidden (view full) --- 101 int ret = 1; 102 DSA *dsa = NULL; 103 int i, badops = 0; 104 const EVP_CIPHER *enc = NULL; 105 BIO *in = NULL, *out = NULL; 106 int informat, outformat, text = 0, noout = 0; 107 int pubin = 0, pubout = 0; 108 char *infile, *outfile, *prog; |
109# ifndef OPENSSL_NO_ENGINE | |
110 char *engine; | 109 char *engine; |
111# endif | |
112 char *passargin = NULL, *passargout = NULL; 113 char *passin = NULL, *passout = NULL; 114 int modulus = 0; 115 116 int pvk_encr = 2; 117 118 apps_startup(); 119 120 if (bio_err == NULL) 121 if ((bio_err = BIO_new(BIO_s_file())) != NULL) 122 BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT); 123 124 if (!load_config(bio_err, NULL)) 125 goto end; 126 | 110 char *passargin = NULL, *passargout = NULL; 111 char *passin = NULL, *passout = NULL; 112 int modulus = 0; 113 114 int pvk_encr = 2; 115 116 apps_startup(); 117 118 if (bio_err == NULL) 119 if ((bio_err = BIO_new(BIO_s_file())) != NULL) 120 BIO_set_fp(bio_err, stderr, BIO_NOCLOSE | BIO_FP_TEXT); 121 122 if (!load_config(bio_err, NULL)) 123 goto end; 124 |
127# ifndef OPENSSL_NO_ENGINE | |
128 engine = NULL; | 125 engine = NULL; |
129# endif | |
130 infile = NULL; 131 outfile = NULL; 132 informat = FORMAT_PEM; 133 outformat = FORMAT_PEM; 134 135 prog = argv[0]; 136 argc--; 137 argv++; --- 96 unchanged lines hidden (view full) --- 234 BIO_printf(bio_err, " -text print the key in text\n"); 235 BIO_printf(bio_err, " -noout don't print key out\n"); 236 BIO_printf(bio_err, " -modulus print the DSA public value\n"); 237 goto end; 238 } 239 240 ERR_load_crypto_strings(); 241 | 126 infile = NULL; 127 outfile = NULL; 128 informat = FORMAT_PEM; 129 outformat = FORMAT_PEM; 130 131 prog = argv[0]; 132 argc--; 133 argv++; --- 96 unchanged lines hidden (view full) --- 230 BIO_printf(bio_err, " -text print the key in text\n"); 231 BIO_printf(bio_err, " -noout don't print key out\n"); 232 BIO_printf(bio_err, " -modulus print the DSA public value\n"); 233 goto end; 234 } 235 236 ERR_load_crypto_strings(); 237 |
242# ifndef OPENSSL_NO_ENGINE | |
243 e = setup_engine(bio_err, engine, 0); | 238 e = setup_engine(bio_err, engine, 0); |
244# endif | |
245 246 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) { 247 BIO_printf(bio_err, "Error getting passwords\n"); 248 goto end; 249 } 250 251 in = BIO_new(BIO_s_file()); 252 out = BIO_new(BIO_s_file()); --- 100 unchanged lines hidden (view full) --- 353 ret = 0; 354 end: 355 if (in != NULL) 356 BIO_free(in); 357 if (out != NULL) 358 BIO_free_all(out); 359 if (dsa != NULL) 360 DSA_free(dsa); | 239 240 if (!app_passwd(bio_err, passargin, passargout, &passin, &passout)) { 241 BIO_printf(bio_err, "Error getting passwords\n"); 242 goto end; 243 } 244 245 in = BIO_new(BIO_s_file()); 246 out = BIO_new(BIO_s_file()); --- 100 unchanged lines hidden (view full) --- 347 ret = 0; 348 end: 349 if (in != NULL) 350 BIO_free(in); 351 if (out != NULL) 352 BIO_free_all(out); 353 if (dsa != NULL) 354 DSA_free(dsa); |
355 release_engine(e); |
|
361 if (passin) 362 OPENSSL_free(passin); 363 if (passout) 364 OPENSSL_free(passout); 365 apps_shutdown(); 366 OPENSSL_EXIT(ret); 367} 368#else /* !OPENSSL_NO_DSA */ 369 370# if PEDANTIC 371static void *dummy = &dummy; 372# endif 373 374#endif | 356 if (passin) 357 OPENSSL_free(passin); 358 if (passout) 359 OPENSSL_free(passout); 360 apps_shutdown(); 361 OPENSSL_EXIT(ret); 362} 363#else /* !OPENSSL_NO_DSA */ 364 365# if PEDANTIC 366static void *dummy = &dummy; 367# endif 368 369#endif |