X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fdsaparam.c;h=2f436803e36ce598d417f16303626b361fc021a5;hp=d3501c2606068861471f7ac750377f37681cb267;hb=77c46bbf2997e68e1974ed90bacdf236fedf1242;hpb=c06648f7f00002c84e92cec6b819f7053401ad9c diff --git a/apps/dsaparam.c b/apps/dsaparam.c index d3501c2606..2f436803e3 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -56,7 +56,7 @@ * [including the GNU Public Licence.] */ -#ifndef NO_DSA +#ifndef OPENSSL_NO_DSA #include #include #include @@ -69,7 +69,6 @@ #include #include #include -#include #undef PROG #define PROG dsaparam_main @@ -107,6 +106,9 @@ int MAIN(int argc, char **argv) if ((bio_err=BIO_new(BIO_s_file())) != NULL) BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); + if (!load_config(bio_err, NULL)) + goto end; + infile=NULL; outfile=NULL; informat=FORMAT_PEM; @@ -184,9 +186,10 @@ bad: BIO_printf(bio_err," -outform arg output format - DER or PEM\n"); BIO_printf(bio_err," -in arg input file\n"); BIO_printf(bio_err," -out arg output file\n"); - BIO_printf(bio_err," -text print the key in text\n"); + BIO_printf(bio_err," -text print as text\n"); BIO_printf(bio_err," -C Output C code\n"); BIO_printf(bio_err," -noout no output\n"); + BIO_printf(bio_err," -genkey generate a DSA key\n"); BIO_printf(bio_err," -rand files to use for random number input\n"); BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); BIO_printf(bio_err," number number of bits to use for generating private key\n"); @@ -216,7 +219,7 @@ bad: if (outfile == NULL) { BIO_set_fp(out,stdout,BIO_NOCLOSE); -#ifdef VMS +#ifdef OPENSSL_SYS_VMS { BIO *tmpbio = BIO_new(BIO_f_linebuffer()); out = BIO_push(tmpbio, out); @@ -232,23 +235,7 @@ bad: } } - if (engine != NULL) - { - if((e = ENGINE_by_id(engine)) == NULL) - { - BIO_printf(bio_err,"invalid engine \"%s\"\n", - engine); - goto end; - } - if(!ENGINE_set_default(e, ENGINE_METHOD_ALL)) - { - BIO_printf(bio_err,"can't use that engine\n"); - goto end; - } - BIO_printf(bio_err,"engine \"%s\" set.\n", engine); - /* Free our "structural" reference. */ - ENGINE_free(e); - } + e = setup_engine(bio_err, engine, 0); if (need_rand) { @@ -384,6 +371,7 @@ end: if (in != NULL) BIO_free(in); if (out != NULL) BIO_free_all(out); if (dsa != NULL) DSA_free(dsa); + apps_shutdown(); EXIT(ret); }