X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=apps%2Fgendh.c;h=574a13a57aa7968a7a976a8b362f8deda3a90df3;hp=0b47867c2036289cb5144b60f29d73bd331e436f;hb=e23500016938ea5e69a064c398efd71d0a3e1037;hpb=bc36ee6227517edae802bcb0da68d4f04fe1fb5e diff --git a/apps/gendh.c b/apps/gendh.c index 0b47867c20..574a13a57a 100644 --- a/apps/gendh.c +++ b/apps/gendh.c @@ -57,6 +57,12 @@ * [including the GNU Public Licence.] */ +/* Until the key-gen callbacks are modified to use newer prototypes, we allow + * deprecated functions for openssl-internal code */ +#ifdef OPENSSL_NO_DEPRECATED +#undef OPENSSL_NO_DEPRECATED +#endif + #ifndef OPENSSL_NO_DH #include #include @@ -70,7 +76,6 @@ #include #include #include -#include #define DEFBITS 512 #undef PROG @@ -97,6 +102,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; + argv++; argc--; for (;;) @@ -143,23 +151,7 @@ bad: goto end; } - 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); out=BIO_new(BIO_s_file()); if (out == NULL) @@ -211,7 +203,8 @@ end: ERR_print_errors(bio_err); if (out != NULL) BIO_free_all(out); if (dh != NULL) DH_free(dh); - EXIT(ret); + apps_shutdown(); + OPENSSL_EXIT(ret); } static void MS_CALLBACK dh_cb(int p, int n, void *arg)