summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorUlf Möller <ulf@openssl.org>2000-01-14 02:31:32 +0000
committerUlf Möller <ulf@openssl.org>2000-01-14 02:31:32 +0000
commitf2b86c955cb6c3c3864b38850d573e3aa6659a33 (patch)
tree83de04a2a08c73f847392bbb190ccff1475beccd /crypto
parent11afb40c011a789396d4e06682f73f55c33dff8a (diff)
minor change for the prng
Diffstat (limited to 'crypto')
-rw-r--r--crypto/rand/md_rand.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index d727fff924..5eef93d4bd 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -360,15 +360,13 @@ static int ssleay_rand_bytes(unsigned char *buf, int num)
*/
if ((fh = fopen(DEVRANDOM, "r")) != NULL)
{
- unsigned char tmpbuf[32];
+ unsigned char tmpbuf[ENTROPY_NEEDED];
+ int i;
- fread((unsigned char *)tmpbuf,1,32,fh);
- /* we don't care how many bytes we read,
- * we will just copy the 'stack' if there is
- * nothing else :-) */
+ i=fread((unsigned char *)tmpbuf,1,ENTROPY_NEEDED,fh);
fclose(fh);
- RAND_seed(tmpbuf,32);
- memset(tmpbuf,0,32);
+ RAND_seed(tmpbuf,i);
+ memset(tmpbuf,0,i);
}
#endif
#ifdef PURIFY