mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
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.
This commit is contained in:
parent
96db9023b8
commit
5be1ae28ef
@ -198,6 +198,9 @@ static void ssleay_rand_add(const void *buf, int num, double add)
|
||||
EVP_MD_CTX m;
|
||||
int do_not_lock;
|
||||
|
||||
if (!num)
|
||||
return;
|
||||
|
||||
/*
|
||||
* (Based on the rand(3) manpage)
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user