Return if ssleay_rand_add called with zero num.
Treat a zero length passed to ssleay_rand_add a no op: the existing logic
zeroes the md value which is very bad. OpenSSL itself never does this
internally and the actual call doesn't make sense as it would be passing
zero bytes of entropy.
Thanks to Marcus Meissner <meissner@suse.de> for reporting this bug.
(cherry picked from commit 5be1ae28ef
)
This commit is contained in:
parent
731f431497
commit
f74fa33bce
1 changed files with 3 additions and 0 deletions
|
@ -212,6 +212,9 @@ static int ssleay_rand_add(const void *buf, int num, double add)
|
|||
int do_not_lock;
|
||||
int rv = 0;
|
||||
|
||||
if (!num)
|
||||
return;
|
||||
|
||||
/*
|
||||
* (Based on the rand(3) manpage)
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue