summaryrefslogtreecommitdiffstats
path: root/crypto/rand
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2016-12-07 23:05:16 +0100
committerKurt Roeckx <kurt@roeckx.be>2016-12-08 19:06:18 +0100
commite512840d7a691ec372453bcb5f42e00eec180b18 (patch)
tree437c08a29129c351be51d7c48c6ca584c0602058 /crypto/rand
parent231f13370b52cdf52f286b8cadb0e61308841736 (diff)
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
Diffstat (limited to 'crypto/rand')
-rw-r--r--crypto/rand/md_rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/rand/md_rand.c b/crypto/rand/md_rand.c
index 0cf6e90834..88820bbb91 100644
--- a/crypto/rand/md_rand.c
+++ b/crypto/rand/md_rand.c
@@ -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++;