X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fdsaparam.c;h=c301e81af18ca3f3f3977d76dfc3bf9a44c9f003;hb=3e82dfdf2d0d22da64ac4805a09061b1c6de6925;hp=63e2cab45f545f055514cc11aab901180816d0c8;hpb=5daec7ea0ed73def95c65d4e23d1a22839355332;p=oweals%2Fopenssl.git diff --git a/apps/dsaparam.c b/apps/dsaparam.c index 63e2cab45f..c301e81af1 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -56,6 +56,7 @@ * [including the GNU Public Licence.] */ +#include /* for OPENSSL_NO_DSA */ /* Until the key-gen callbacks are modified to use newer prototypes, we allow * deprecated functions for openssl-internal code */ #ifdef OPENSSL_NO_DEPRECATED @@ -97,7 +98,7 @@ static int stop_keygen_flag = 0; -void timebomb_sigalarm(int foo) +static void timebomb_sigalarm(int foo) { stop_keygen_flag = 1; } @@ -110,7 +111,9 @@ int MAIN(int, char **); int MAIN(int argc, char **argv) { +#ifndef OPENSSL_NO_ENGINE ENGINE *e = NULL; +#endif DSA *dsa=NULL; int i,badops=0,text=0; BIO *in=NULL,*out=NULL; @@ -118,7 +121,9 @@ int MAIN(int argc, char **argv) char *infile,*outfile,*prog,*inrand=NULL; int numbits= -1,num,genkey=0; int need_rand=0; +#ifndef OPENSSL_NO_ENGINE char *engine=NULL; +#endif #ifdef GENCB_TEST int timebomb=0; #endif @@ -162,11 +167,13 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; outfile= *(++argv); } +#ifndef OPENSSL_NO_ENGINE else if(strcmp(*argv, "-engine") == 0) { if (--argc < 1) goto bad; engine = *(++argv); } +#endif #ifdef GENCB_TEST else if(strcmp(*argv, "-timebomb") == 0) { @@ -221,7 +228,9 @@ bad: 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"); +#ifndef OPENSSL_NO_ENGINE BIO_printf(bio_err," -engine e use engine e, possibly a hardware device.\n"); +#endif #ifdef GENCB_TEST BIO_printf(bio_err," -timebomb n interrupt keygen after seconds\n"); #endif @@ -268,7 +277,9 @@ bad: } } +#ifndef OPENSSL_NO_ENGINE e = setup_engine(bio_err, engine, 0); +#endif if (need_rand) { @@ -281,10 +292,7 @@ bad: if (numbits > 0) { BN_GENCB cb; - cb.ver = 2; - cb.cb_2 = dsa_cb; - cb.arg = bio_err; - + BN_GENCB_set(&cb, dsa_cb, bio_err); assert(need_rand); dsa = DSA_new(); if(!dsa)