Prevent handshake with unseeded PRNG
[oweals/openssl.git] / ssl / s3_clnt.c
index 1e437b2e1e9abb36657fc5f73ca0a7567ebccc7f..750217fff6af064615e8c193523123c2388026fe 100644 (file)
@@ -719,8 +719,9 @@ int ssl3_client_hello(SSL *s)
         } else
             i = 1;
 
-        if (i)
-            ssl_fill_hello_random(s, 0, p, sizeof(s->s3->client_random));
+        if (i && ssl_fill_hello_random(s, 0, p,
+                                       sizeof(s->s3->client_random)) <= 0)
+            goto err;
 
         /* Do the message type and length last */
         d = p = ssl_handshake_start(s);