From e512840d7a691ec372453bcb5f42e00eec180b18 Mon Sep 17 00:00:00 2001 From: Kurt Roeckx Date: Wed, 7 Dec 2016 23:05:16 +0100 Subject: [PATCH] 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 GH: #2041 --- crypto/rand/md_rand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++; -- 2.25.1