X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fecparam.c;h=55d71f7fd41e597be45b21f957f00e7834ba25d4;hp=9d13447283a6d4c643fa8ae95da43f2b9f516704;hb=d6482a82bc2228327aa4ba98aeeecd9979542a31;hpb=a0a82324f965bbcc4faed4e1ee3fcaf81ea52166 diff --git a/apps/ecparam.c b/apps/ecparam.c index 9d13447283..55d71f7fd4 100644 --- a/apps/ecparam.c +++ b/apps/ecparam.c @@ -69,7 +69,10 @@ */ #include -#ifndef OPENSSL_NO_EC +#ifdef OPENSSL_NO_EC +NON_EMPTY_TRANSLATION_UNIT +#else + # include # include # include @@ -217,7 +220,9 @@ int ecparam_main(int argc, char **argv) } } argc = opt_num_rest(); - argv = opt_rest(); + if (argc != 0) + goto opthelp; + private = genkey ? 1 : 0; in = bio_open_default(infile, 'r', informat); @@ -317,8 +322,6 @@ int ecparam_main(int argc, char **argv) } if (check) { - if (group == NULL) - BIO_printf(bio_err, "no elliptic curve parameters\n"); BIO_printf(bio_err, "checking elliptic curve parameters: "); if (!EC_GROUP_check(group, NULL)) { BIO_printf(bio_err, "failed\n"); @@ -464,11 +467,17 @@ int ecparam_main(int argc, char **argv) assert(need_rand); - if (EC_KEY_set_group(eckey, group) == 0) + if (EC_KEY_set_group(eckey, group) == 0) { + BIO_printf(bio_err, "unable to set group when generating key\n"); + EC_KEY_free(eckey); + ERR_print_errors(bio_err); goto end; + } if (!EC_KEY_generate_key(eckey)) { + BIO_printf(bio_err, "unable to generate key\n"); EC_KEY_free(eckey); + ERR_print_errors(bio_err); goto end; } assert(private); @@ -498,10 +507,4 @@ int ecparam_main(int argc, char **argv) return (ret); } -#else /* !OPENSSL_NO_EC */ - -# if PEDANTIC -static void *dummy = &dummy; -# endif - #endif