diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-25 17:06:56 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-27 15:02:34 +0100 |
commit | 05200ee5c61ecd38cdcacf9c547b0c3877e8cfef (patch) | |
tree | bd2cd4dfc1dc820e0287a289867cc49c8ac38cc7 /ssl/s23_clnt.c | |
parent | 3681a4558c13198944e6f7f149c4be188e076e14 (diff) |
Change usage of RAND_pseudo_bytes to RAND_bytes
RAND_pseudo_bytes() allows random data to be returned even in low entropy
conditions. Sometimes this is ok. Many times it is not. For the avoidance
of any doubt, replace existing usage of RAND_pseudo_bytes() with
RAND_bytes().
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r-- | ssl/s23_clnt.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index 2b2855dee4..e93baed43a 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -290,9 +290,9 @@ int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len) unsigned long Time = (unsigned long)time(NULL); unsigned char *p = result; l2n(Time, p); - return RAND_pseudo_bytes(p, len - 4); + return RAND_bytes(p, len - 4); } else - return RAND_pseudo_bytes(result, len); + return RAND_bytes(result, len); } static int ssl23_client_hello(SSL *s) @@ -460,8 +460,8 @@ static int ssl23_client_hello(SSL *s) i = ch_len; s2n(i, d); memset(&(s->s3->client_random[0]), 0, SSL3_RANDOM_SIZE); - if (RAND_pseudo_bytes - (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i) <= 0) + if (RAND_bytes (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i) + <= 0) return -1; memcpy(p, &(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i); |