mirror of
https://github.com/openssl/openssl.git
synced 2024-11-29 21:14:01 +08:00
Don't cheat: when only getting several bytes from each source, n is incremented
correctly, but RAND_add(..,n) counts the increasing n several times. Only RAND_add(..,n) once entropy collection is finished.
This commit is contained in:
parent
3c91484052
commit
28e5428d5d
@ -183,10 +183,13 @@ int RAND_poll(void)
|
||||
&& t.tv_usec != 0 && n < ENTROPY_NEEDED);
|
||||
|
||||
close(fd);
|
||||
RAND_add(tmpbuf,sizeof tmpbuf,n);
|
||||
memset(tmpbuf,0,n);
|
||||
}
|
||||
}
|
||||
if (n > 0)
|
||||
{
|
||||
RAND_add(tmpbuf,sizeof tmpbuf,n);
|
||||
memset(tmpbuf,0,n);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* put in some default random data, we need more than just this */
|
||||
|
Loading…
Reference in New Issue
Block a user