]> granicus.if.org Git - curl/commitdiff
openssl: avoid unnecessary seeding if already done
authorDaniel Stenberg <daniel@haxx.se>
Fri, 11 Nov 2016 12:54:16 +0000 (13:54 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 11 Nov 2016 12:54:16 +0000 (13:54 +0100)
1.1.0+ does more of this by itself so we can avoid extra processing this
way.

lib/vtls/openssl.c

index 9cf36b3581b7a453574cfff9a2d9691e5c50e513..fa128fa46a658cf54b0b4020a7bdf9b78555f1c9 100644 (file)
@@ -188,8 +188,8 @@ static int ossl_seed(struct Curl_easy *data)
   char *buf = data->state.buffer; /* point to the big buffer */
   int nread=0;
 
-  /* Q: should we add support for a random file name as a libcurl option?
-     A: Yes, it is here */
+  if(rand_enough())
+    return 1;
 
 #ifndef RANDOM_FILE
   /* if RANDOM_FILE isn't defined, we only perform this if an option tells