check return value of RAND_pseudo_bytes; backport from the stable branch

This commit is contained in:
Nils Larsch
2005-04-29 20:10:06 +00:00
parent 38be5db93b
commit 7c7667b86b
7 changed files with 24 additions and 23 deletions

View File

@@ -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;