OLD | NEW |
1 /* apps/ec.c */ | 1 /* apps/ec.c */ |
2 /* | 2 /* |
3 * Written by Nils Larsch for the OpenSSL project. | 3 * Written by Nils Larsch for the OpenSSL project. |
4 */ | 4 */ |
5 /* ==================================================================== | 5 /* ==================================================================== |
6 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. | 6 * Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. |
7 * | 7 * |
8 * Redistribution and use in source and binary forms, with or without | 8 * Redistribution and use in source and binary forms, with or without |
9 * modification, are permitted provided that the following conditions | 9 * modification, are permitted provided that the following conditions |
10 * are met: | 10 * are met: |
(...skipping 67 matching lines...) Loading... |
78 * -text - print a text version | 78 * -text - print a text version |
79 * -param_out - print the elliptic curve parameters | 79 * -param_out - print the elliptic curve parameters |
80 * -conv_form arg - specifies the point encoding form | 80 * -conv_form arg - specifies the point encoding form |
81 * -param_enc arg - specifies the parameter encoding | 81 * -param_enc arg - specifies the parameter encoding |
82 */ | 82 */ |
83 | 83 |
84 int MAIN(int, char **); | 84 int MAIN(int, char **); |
85 | 85 |
86 int MAIN(int argc, char **argv) | 86 int MAIN(int argc, char **argv) |
87 { | 87 { |
88 #ifndef OPENSSL_NO_ENGINE | |
89 ENGINE *e = NULL; | |
90 #endif | |
91 int ret = 1; | 88 int ret = 1; |
92 EC_KEY *eckey = NULL; | 89 EC_KEY *eckey = NULL; |
93 const EC_GROUP *group; | 90 const EC_GROUP *group; |
94 int i, badops = 0; | 91 int i, badops = 0; |
95 const EVP_CIPHER *enc = NULL; | 92 const EVP_CIPHER *enc = NULL; |
96 BIO *in = NULL, *out = NULL; | 93 BIO *in = NULL, *out = NULL; |
97 int informat, outformat, text=0, noout=0; | 94 int informat, outformat, text=0, noout=0; |
98 int pubin = 0, pubout = 0, param_out = 0; | 95 int pubin = 0, pubout = 0, param_out = 0; |
99 char *infile, *outfile, *prog, *engine; | 96 char *infile, *outfile, *prog, *engine; |
100 char *passargin = NULL, *passargout = NULL; | 97 char *passargin = NULL, *passargout = NULL; |
(...skipping 146 matching lines...) Loading... |
247 BIO_printf(bio_err, " possible values:" | 244 BIO_printf(bio_err, " possible values:" |
248 " named_curve (default)\n"); | 245 " named_curve (default)\n"); |
249 BIO_printf(bio_err," " | 246 BIO_printf(bio_err," " |
250 "explicit\n"); | 247 "explicit\n"); |
251 goto end; | 248 goto end; |
252 } | 249 } |
253 | 250 |
254 ERR_load_crypto_strings(); | 251 ERR_load_crypto_strings(); |
255 | 252 |
256 #ifndef OPENSSL_NO_ENGINE | 253 #ifndef OPENSSL_NO_ENGINE |
257 e = setup_engine(bio_err, engine, 0); | 254 setup_engine(bio_err, engine, 0); |
258 #endif | 255 #endif |
259 | 256 |
260 if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) | 257 if(!app_passwd(bio_err, passargin, passargout, &passin, &passout)) |
261 { | 258 { |
262 BIO_printf(bio_err, "Error getting passwords\n"); | 259 BIO_printf(bio_err, "Error getting passwords\n"); |
263 goto end; | 260 goto end; |
264 } | 261 } |
265 | 262 |
266 in = BIO_new(BIO_s_file()); | 263 in = BIO_new(BIO_s_file()); |
267 out = BIO_new(BIO_s_file()); | 264 out = BIO_new(BIO_s_file()); |
(...skipping 125 matching lines...) Loading... |
393 BIO_free_all(out); | 390 BIO_free_all(out); |
394 if (eckey) | 391 if (eckey) |
395 EC_KEY_free(eckey); | 392 EC_KEY_free(eckey); |
396 if (passin) | 393 if (passin) |
397 OPENSSL_free(passin); | 394 OPENSSL_free(passin); |
398 if (passout) | 395 if (passout) |
399 OPENSSL_free(passout); | 396 OPENSSL_free(passout); |
400 apps_shutdown(); | 397 apps_shutdown(); |
401 OPENSSL_EXIT(ret); | 398 OPENSSL_EXIT(ret); |
402 } | 399 } |
| 400 #else /* !OPENSSL_NO_EC */ |
| 401 |
| 402 # if PEDANTIC |
| 403 static void *dummy=&dummy; |
| 404 # endif |
| 405 |
403 #endif | 406 #endif |
OLD | NEW |