Hi guys,
   Here's a diff that enables Gcrypt's "enable quick random numbers" option 
while Cherokee starts up. This speeds up SSL/TLS on my Linksys NSLU2 by a few 
orders of magnitude...

   This is already in trunk, but might help someone who wants to use the 
debian-stable version of Cherokee without having to upgrade to 0.6 (which 
seems to be 'under heavy development' at the moment).

--- cherokee/util.c  2006-12-07 18:46:28.000000000 +0000
+++ cherokee/util.c  2007-12-06 20:24:07.000000000 +0000
@@ -79,6 +79,7 @@
  #endif

  #if defined(HAVE_GNUTLS)
+# include <gcrypt.h>
  # include <gnutls/gnutls.h>
  #elif defined(HAVE_OPENSSL)
  # include <openssl/lhash.h>
@@ -732,6 +733,11 @@
         gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
  # endif

+       /* Try to speed up random number generation. On Linux, it
+        * takes ages for GNUTLS to get the random numbers it needs.
+        */
+       gcry_control (GCRYCTL_ENABLE_QUICK_RANDOM, 0);
+
         /* Gnutls library-width initialization
          */
         rc = gnutls_global_init();

Thanks,
-- 
Phil.                         |  (\_/)  This is Bunny. Copy and paste Bunny
[EMAIL PROTECTED]           | (='.'=) into your signature to help him gain
http://www.philpem.me.uk/     | (")_(") world domination.
_______________________________________________
Cherokee mailing list
[email protected]
http://cherokee-project.com/cgi-bin/mailman/listinfo/cherokee

Reply via email to