Loading apps/dhparam.c +14 −3 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ #include <openssl/dh.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #ifndef NO_DSA #include <openssl/dsa.h> Loading Loading @@ -156,7 +157,7 @@ int MAIN(int argc, char **argv) BIO *in=NULL,*out=NULL; int informat,outformat,check=0,noout=0,C=0,ret=1; char *infile,*outfile,*prog; char *inrand=NULL; char *inrand=NULL, *inegd=NULL; int num = 0, g = 0; apps_startup(); Loading Loading @@ -216,6 +217,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else if (((sscanf(*argv,"%d",&num) == 0) || (num <= 0))) goto bad; argv++; Loading @@ -241,8 +247,9 @@ bad: BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n"); BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); BIO_printf(bio_err," -noout no output\n"); goto end; } Loading Loading @@ -271,13 +278,17 @@ bad: if(num) { if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); #ifndef NO_DSA if (dsaparam) Loading apps/dsaparam.c +17 −3 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ #include <openssl/dsa.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #undef PROG #define PROG dsaparam_main Loading @@ -94,7 +95,7 @@ int MAIN(int argc, char **argv) int i,badops=0,text=0; BIO *in=NULL,*out=NULL; int informat,outformat,noout=0,C=0,ret=1; char *infile,*outfile,*prog,*inrand=NULL; char *infile,*outfile,*prog,*inrand=NULL,*inegd=NULL; int numbits= -1,num,genkey=0; int need_rand=0; Loading Loading @@ -149,6 +150,12 @@ int MAIN(int argc, char **argv) inrand= *(++argv); need_rand=1; } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); need_rand=1; } else if (strcmp(*argv,"-noout") == 0) noout=1; else if (sscanf(*argv,"%d",&num) == 1) Loading Loading @@ -179,7 +186,10 @@ bad: BIO_printf(bio_err," -text print the key in text\n"); BIO_printf(bio_err," -C Output C code\n"); BIO_printf(bio_err," -noout no output\n"); BIO_printf(bio_err," -rand files to use for random number input\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); BIO_printf(bio_err," number number of bits to use for generating private key\n"); goto end; } Loading Loading @@ -217,10 +227,14 @@ bad: if (need_rand) { app_RAND_load_file(NULL, bio_err, (inrand != NULL)); app_RAND_load_file(NULL, bio_err, (inrand != NULL || inegd != NULL)); if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); } if (numbits > 0) Loading apps/gendh.c +14 −5 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ int MAIN(int argc, char **argv) int ret=1,num=DEFBITS; int g=2; char *outfile=NULL; char *inrand=NULL; char *inrand=NULL,*inegd=NULL; BIO *out=NULL; apps_startup(); Loading Loading @@ -115,6 +115,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else break; argv++; Loading @@ -125,12 +130,13 @@ int MAIN(int argc, char **argv) bad: BIO_printf(bio_err,"usage: gendh [args] [numbits]\n"); BIO_printf(bio_err," -out file - output the key to 'file\n"); BIO_printf(bio_err," -2 use 2 as the generator value\n"); /* BIO_printf(bio_err," -3 use 3 as the generator value\n"); */ BIO_printf(bio_err," -5 use 5 as the generator value\n"); BIO_printf(bio_err," -2 - use 2 as the generator value\n"); /* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */ BIO_printf(bio_err," -5 - use 5 as the generator value\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file - load random seed from EGD socket\n"); goto end; } Loading @@ -152,13 +158,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); Loading apps/gendsa.c +12 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ #include <openssl/dsa.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #define DEFBITS 512 #undef PROG Loading @@ -80,7 +81,7 @@ int MAIN(int argc, char **argv) DSA *dsa=NULL; int ret=1; char *outfile=NULL; char *inrand=NULL,*dsaparams=NULL; char *inrand=NULL,*inegd=NULL,*dsaparams=NULL; char *passargout = NULL, *passout = NULL; BIO *out=NULL,*in=NULL; EVP_CIPHER *enc=NULL; Loading Loading @@ -111,6 +112,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else if (strcmp(*argv,"-") == 0) goto bad; #ifndef NO_DES Loading Loading @@ -148,6 +154,7 @@ bad: BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file - load random seed from EGD socket\n"); BIO_printf(bio_err," dsaparam-file\n"); BIO_printf(bio_err," - a DSA parameter file as generated by the dsaparam command\n"); goto end; Loading Loading @@ -188,13 +195,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating DSA key, %d bits\n", BN_num_bits(dsa->p)); Loading apps/genrsa.c +12 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ #include <openssl/evp.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #define DEFBITS 512 #undef PROG Loading @@ -88,7 +89,7 @@ int MAIN(int argc, char **argv) unsigned long f4=RSA_F4; char *outfile=NULL; char *passargout = NULL, *passout = NULL; char *inrand=NULL; char *inrand=NULL,*inegd=NULL; BIO *out=NULL; apps_startup(); Loading Loading @@ -121,6 +122,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } #ifndef NO_DES else if (strcmp(*argv,"-des") == 0) enc=EVP_des_cbc(); Loading Loading @@ -157,6 +163,7 @@ bad: BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); goto err; } Loading @@ -178,13 +185,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); Loading Loading
apps/dhparam.c +14 −3 Original line number Diff line number Diff line Loading @@ -121,6 +121,7 @@ #include <openssl/dh.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #ifndef NO_DSA #include <openssl/dsa.h> Loading Loading @@ -156,7 +157,7 @@ int MAIN(int argc, char **argv) BIO *in=NULL,*out=NULL; int informat,outformat,check=0,noout=0,C=0,ret=1; char *infile,*outfile,*prog; char *inrand=NULL; char *inrand=NULL, *inegd=NULL; int num = 0, g = 0; apps_startup(); Loading Loading @@ -216,6 +217,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else if (((sscanf(*argv,"%d",&num) == 0) || (num <= 0))) goto bad; argv++; Loading @@ -241,8 +247,9 @@ bad: BIO_printf(bio_err," -5 generate parameters using 5 as the generator value\n"); BIO_printf(bio_err," numbits number of bits in to generate (default 512)\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); BIO_printf(bio_err," -noout no output\n"); goto end; } Loading Loading @@ -271,13 +278,17 @@ bad: if(num) { if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); #ifndef NO_DSA if (dsaparam) Loading
apps/dsaparam.c +17 −3 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ #include <openssl/dsa.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #undef PROG #define PROG dsaparam_main Loading @@ -94,7 +95,7 @@ int MAIN(int argc, char **argv) int i,badops=0,text=0; BIO *in=NULL,*out=NULL; int informat,outformat,noout=0,C=0,ret=1; char *infile,*outfile,*prog,*inrand=NULL; char *infile,*outfile,*prog,*inrand=NULL,*inegd=NULL; int numbits= -1,num,genkey=0; int need_rand=0; Loading Loading @@ -149,6 +150,12 @@ int MAIN(int argc, char **argv) inrand= *(++argv); need_rand=1; } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); need_rand=1; } else if (strcmp(*argv,"-noout") == 0) noout=1; else if (sscanf(*argv,"%d",&num) == 1) Loading Loading @@ -179,7 +186,10 @@ bad: BIO_printf(bio_err," -text print the key in text\n"); BIO_printf(bio_err," -C Output C code\n"); BIO_printf(bio_err," -noout no output\n"); BIO_printf(bio_err," -rand files to use for random number input\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); BIO_printf(bio_err," number number of bits to use for generating private key\n"); goto end; } Loading Loading @@ -217,10 +227,14 @@ bad: if (need_rand) { app_RAND_load_file(NULL, bio_err, (inrand != NULL)); app_RAND_load_file(NULL, bio_err, (inrand != NULL || inegd != NULL)); if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); } if (numbits > 0) Loading
apps/gendh.c +14 −5 Original line number Diff line number Diff line Loading @@ -85,7 +85,7 @@ int MAIN(int argc, char **argv) int ret=1,num=DEFBITS; int g=2; char *outfile=NULL; char *inrand=NULL; char *inrand=NULL,*inegd=NULL; BIO *out=NULL; apps_startup(); Loading Loading @@ -115,6 +115,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else break; argv++; Loading @@ -125,12 +130,13 @@ int MAIN(int argc, char **argv) bad: BIO_printf(bio_err,"usage: gendh [args] [numbits]\n"); BIO_printf(bio_err," -out file - output the key to 'file\n"); BIO_printf(bio_err," -2 use 2 as the generator value\n"); /* BIO_printf(bio_err," -3 use 3 as the generator value\n"); */ BIO_printf(bio_err," -5 use 5 as the generator value\n"); BIO_printf(bio_err," -2 - use 2 as the generator value\n"); /* BIO_printf(bio_err," -3 - use 3 as the generator value\n"); */ BIO_printf(bio_err," -5 - use 5 as the generator value\n"); BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file - load random seed from EGD socket\n"); goto end; } Loading @@ -152,13 +158,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating DH parameters, %d bit long safe prime, generator %d\n",num,g); BIO_printf(bio_err,"This is going to take a long time\n"); Loading
apps/gendsa.c +12 −2 Original line number Diff line number Diff line Loading @@ -68,6 +68,7 @@ #include <openssl/dsa.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #define DEFBITS 512 #undef PROG Loading @@ -80,7 +81,7 @@ int MAIN(int argc, char **argv) DSA *dsa=NULL; int ret=1; char *outfile=NULL; char *inrand=NULL,*dsaparams=NULL; char *inrand=NULL,*inegd=NULL,*dsaparams=NULL; char *passargout = NULL, *passout = NULL; BIO *out=NULL,*in=NULL; EVP_CIPHER *enc=NULL; Loading Loading @@ -111,6 +112,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } else if (strcmp(*argv,"-") == 0) goto bad; #ifndef NO_DES Loading Loading @@ -148,6 +154,7 @@ bad: BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," - load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file - load random seed from EGD socket\n"); BIO_printf(bio_err," dsaparam-file\n"); BIO_printf(bio_err," - a DSA parameter file as generated by the dsaparam command\n"); goto end; Loading Loading @@ -188,13 +195,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating DSA key, %d bits\n", BN_num_bits(dsa->p)); Loading
apps/genrsa.c +12 −2 Original line number Diff line number Diff line Loading @@ -69,6 +69,7 @@ #include <openssl/evp.h> #include <openssl/x509.h> #include <openssl/pem.h> #include <openssl/rand.h> #define DEFBITS 512 #undef PROG Loading @@ -88,7 +89,7 @@ int MAIN(int argc, char **argv) unsigned long f4=RSA_F4; char *outfile=NULL; char *passargout = NULL, *passout = NULL; char *inrand=NULL; char *inrand=NULL,*inegd=NULL; BIO *out=NULL; apps_startup(); Loading Loading @@ -121,6 +122,11 @@ int MAIN(int argc, char **argv) if (--argc < 1) goto bad; inrand= *(++argv); } else if (strcmp(*argv,"-egd") == 0) { if (--argc < 1) goto bad; inegd= *(++argv); } #ifndef NO_DES else if (strcmp(*argv,"-des") == 0) enc=EVP_des_cbc(); Loading Loading @@ -157,6 +163,7 @@ bad: BIO_printf(bio_err," -rand file%cfile%c...\n", LIST_SEPARATOR_CHAR, LIST_SEPARATOR_CHAR); BIO_printf(bio_err," load the file (or the files in the directory) into\n"); BIO_printf(bio_err," the random number generator\n"); BIO_printf(bio_err," -egd file load random seed from EGD socket\n"); goto err; } Loading @@ -178,13 +185,16 @@ bad: } } if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL) if (!app_RAND_load_file(NULL, bio_err, 1) && inrand == NULL && inegd == NULL) { BIO_printf(bio_err,"warning, not much extra random data, consider using the -rand option\n"); } if (inrand != NULL) BIO_printf(bio_err,"%ld semi-random bytes loaded\n", app_RAND_load_files(inrand)); if (inegd != NULL) BIO_printf(bio_err,"%ld egd bytes loaded\n", RAND_egd(inegd)); BIO_printf(bio_err,"Generating RSA private key, %d bit long modulus\n", num); Loading