mirror of
https://github.com/openssl/openssl.git
synced 2025-02-17 14:32:04 +08:00
Make the predictable numbers start from 1
There is code that retries calling RAND_bytes() until it gets something other than 0, which just hangs if we always return 0. Reviewed-by: Rich Salz <rsalz@openssl.org> GH: #2041
This commit is contained in:
parent
231f13370b
commit
e512840d7a
@ -307,7 +307,7 @@ static int rand_bytes(unsigned char *buf, int num, int pseudo)
|
||||
|
||||
#ifdef PREDICT
|
||||
if (rand_predictable) {
|
||||
unsigned char val = 0;
|
||||
unsigned char val = 1;
|
||||
|
||||
for (i = 0; i < num; i++)
|
||||
buf[i] = val++;
|
||||
|
Loading…
Reference in New Issue
Block a user