projects
/
oweals
/
openssl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
410243f
)
pseudo-seed for the PRNG before testing DSA
author
Ulf Möller
<ulf@openssl.org>
Wed, 1 Mar 2000 17:42:06 +0000
(17:42 +0000)
committer
Ulf Möller
<ulf@openssl.org>
Wed, 1 Mar 2000 17:42:06 +0000
(17:42 +0000)
apps/speed.c
patch
|
blob
|
history
apps/testdsa.h
patch
|
blob
|
history
diff --git
a/apps/speed.c
b/apps/speed.c
index b3130def8b928b0ea43d915eb39f8fe8ca58ae0c..f7a8e00a8bc29923b7cc9c2b7d91b1df82b3baa7 100644
(file)
--- a/
apps/speed.c
+++ b/
apps/speed.c
@@
-1030,6
+1030,11
@@
int MAIN(int argc, char **argv)
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
@@
int MAIN(int argc, char **argv)
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 a322978f8c2efaadfea17d1812111e685c1db91c..4a453d4fbc0d8a1b644340e5ab5decd7928344f6 100644
(file)
--- a/
apps/testdsa.h
+++ b/
apps/testdsa.h
@@
-146,3
+146,5
@@
DSA *get_dsa2048()
return(dsa);
}
+static const char rnd_seed[] = "string to make the random number generator think it has entropy";
+static int rnd_fake = 0;