]> granicus.if.org Git - curl/commitdiff
ossl_seed: no more RAND_screen
authorDaniel Stenberg <daniel@haxx.se>
Thu, 23 Dec 2010 13:36:07 +0000 (14:36 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 23 Dec 2010 13:36:07 +0000 (14:36 +0100)
RAND_screen() is slow, not thread-safe and not needed anymore since OpenSSL
uses the thread-safe win32 CryptoAPI nowadays.

lib/ssluse.c

index d8f7760181edf151058e9d48524f86c14d58aeae..9e3fca392de259995c01287693fee5c6ab2c3c17 100644 (file)
@@ -225,7 +225,8 @@ static int ossl_seed(struct SessionHandle *data)
   /* If we get here, it means we need to seed the PRNG using a "silly"
      approach! */
 #ifdef HAVE_RAND_SCREEN
-  /* if RAND_screen() is present, it was called during global init */
+  /* if RAND_screen() is present, this is windows and thus we assume that the
+     randomness is already taken care of */
   nread = 100; /* just a value */
 #else
   {
@@ -685,13 +686,6 @@ int Curl_ossl_init(void)
 
   OpenSSL_add_all_algorithms();
 
-#ifdef HAVE_RAND_SCREEN
-  /* This one gets a random value by reading the currently shown screen.
-     RAND_screen() is not thread-safe according to OpenSSL devs - although not
-     mentioned in documentation. */
-  RAND_screen();
-#endif
-
   return 1;
 }