RAND_bytes updates
Ensure RAND_bytes return value is checked correctly, and that we no longer use RAND_pseudo_bytes. Reviewed-by: Richard Levitte <levitte@openssl.org>
This commit is contained in:
@@ -263,6 +263,7 @@ int ssl23_connect(SSL *s)
|
||||
int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len)
|
||||
{
|
||||
int send_time = 0;
|
||||
|
||||
if (len < 4)
|
||||
return 0;
|
||||
if (server)
|
||||
@@ -273,9 +274,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)
|
||||
|
Reference in New Issue
Block a user