pseudo-seed for the PRNG before testing DSA
diff --git a/apps/speed.c b/apps/speed.c index b3130de..f7a8e00 100644 --- a/apps/speed.c +++ b/apps/speed.c
@@ -1030,6 +1030,11 @@ RAND_pseudo_bytes(buf,20); #ifndef NO_DSA + if (RAND_status() != 1) + { + RAND_seed(rnd_seed, sizeof rnd_seed); + rnd_fake = 1; + } for (j=0; j<DSA_NUM; j++) { unsigned int kk; @@ -1089,6 +1094,7 @@ dsa_doit[j]=0; } } + if (rnd_fake) RAND_cleanup(); #endif fprintf(stdout,"%s\n",SSLeay_version(SSLEAY_VERSION));
diff --git a/apps/testdsa.h b/apps/testdsa.h index a322978..4a453d4 100644 --- a/apps/testdsa.h +++ b/apps/testdsa.h
@@ -146,3 +146,5 @@ return(dsa); } +static const char rnd_seed[] = "string to make the random number generator think it has entropy"; +static int rnd_fake = 0;