X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=apps%2Fgendh.c;h=b3c19581d350370dc6df0a80ece47dec90ab6d08;hb=7e701817234ff2be2a745fc63f32ccb5e874854c;hp=b7b6d0fd629f4c6e8267e9f8455f93c88f7f5b95;hpb=eda1f21f1af8b6f77327e7b37573af9c1ba73726;p=oweals%2Fopenssl.git diff --git a/apps/gendh.c b/apps/gendh.c index b7b6d0fd62..b3c19581d3 100644 --- a/apps/gendh.c +++ b/apps/gendh.c @@ -1,5 +1,5 @@ /* apps/gendh.c */ -/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com) +/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * * This package is an SSL implementation written @@ -56,34 +56,27 @@ * [including the GNU Public Licence.] */ +#ifndef NO_DH #include #include #include #include #include "apps.h" -#include "bio.h" -#include "rand.h" -#include "err.h" -#include "bn.h" -#include "dh.h" -#include "x509.h" -#include "pem.h" +#include +#include +#include +#include +#include +#include +#include #define DEFBITS 512 #undef PROG #define PROG gendh_main -#ifndef NOPROTO -static void MS_CALLBACK dh_cb(int p, int n); +static void MS_CALLBACK dh_cb(int p, int n, char *arg); static long dh_load_rand(char *names); -#else -static void MS_CALLBACK dh_cb(); -static long dh_load_rand(); -#endif - -int MAIN(argc, argv) -int argc; -char **argv; +int MAIN(int argc, char **argv) { char buffer[200]; DH *dh=NULL; @@ -97,7 +90,7 @@ char **argv; if (bio_err == NULL) if ((bio_err=BIO_new(BIO_s_file())) != NULL) - BIO_set_fp(bio_err,stderr,BIO_NOCLOSE); + BIO_set_fp(bio_err,stderr,BIO_NOCLOSE|BIO_FP_TEXT); argv++; argc--; @@ -171,7 +164,7 @@ bad: BIO_printf(bio_err,"Generating DH parameters, %d bit long strong prime, generator of %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); - dh=DH_generate_parameters(num,g,dh_cb); + dh=DH_generate_parameters(num,g,dh_cb,(char *)bio_err); if (dh == NULL) goto end; @@ -191,9 +184,7 @@ end: EXIT(ret); } -static void MS_CALLBACK dh_cb(p, n) -int p; -int n; +static void MS_CALLBACK dh_cb(int p, int n, char *arg) { char c='*'; @@ -201,15 +192,14 @@ int n; if (p == 1) c='+'; if (p == 2) c='*'; if (p == 3) c='\n'; - BIO_write(bio_err,&c,1); - BIO_flush(bio_err); + BIO_write((BIO *)arg,&c,1); + BIO_flush((BIO *)arg); #ifdef LINT p=n; #endif } -static long dh_load_rand(name) -char *name; +static long dh_load_rand(char *name) { char *p,*n; int last; @@ -230,5 +220,4 @@ char *name; } return(tot); } - - +#endif