diff options
author | Nils Larsch <nils@openssl.org> | 2005-04-29 20:10:06 +0000 |
---|---|---|
committer | Nils Larsch <nils@openssl.org> | 2005-04-29 20:10:06 +0000 |
commit | 7c7667b86b481c7516d147cd50ece203d3eb58ab (patch) | |
tree | 8deb77933dbb0e2839b3270bfee9a7a3b3571cf1 /ssl/s23_clnt.c | |
parent | 38be5db93ba435df8d2fbb1caee608ff2266de24 (diff) |
check return value of RAND_pseudo_bytes; backport from the stable branch
Diffstat (limited to 'ssl/s23_clnt.c')
-rw-r--r-- | ssl/s23_clnt.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl/s23_clnt.c b/ssl/s23_clnt.c index 64ee4269ec..3384fb765e 100644 --- a/ssl/s23_clnt.c +++ b/ssl/s23_clnt.c @@ -235,7 +235,8 @@ static int ssl23_client_hello(SSL *s) #endif p=s->s3->client_random; - RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE); + if (RAND_pseudo_bytes(p,SSL3_RANDOM_SIZE) <= 0) + return -1; /* Do the message type and length last */ d= &(buf[2]); @@ -296,7 +297,9 @@ static int ssl23_client_hello(SSL *s) i=ch_len; s2n(i,d); memset(&(s->s3->client_random[0]),0,SSL3_RANDOM_SIZE); - RAND_pseudo_bytes(&(s->s3->client_random[SSL3_RANDOM_SIZE-i]),i); + if (RAND_pseudo_bytes(&(s->s3->client_random[SSL3_RANDOM_SIZE-i]),i) <= 0) + return -1; + memcpy(p,&(s->s3->client_random[SSL3_RANDOM_SIZE-i]),i); p+=i; |