[or-cvs] Once an hour (not just on startup) give OpenSSL some more e...

Nick Mathewson nickm at seul.org
Thu Oct 6 22:22:24 UTC 2005


Update of /home/or/cvsroot/tor/src/common
In directory moria:/tmp/cvs-serv32100/src/common

Modified Files:
	crypto.c 
Log Message:
Once an hour (not just on startup) give OpenSSL some more entropy.
Add entropy in 512-bit chunks, not 160-bit chunks.  (This latter
change is voodoo.)



Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/crypto.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -d -r1.163 -r1.164
--- crypto.c	6 Oct 2005 22:18:01 -0000	1.163
+++ crypto.c	6 Oct 2005 22:22:22 -0000	1.164
@@ -1575,16 +1575,16 @@
 
 /* random numbers */
 
-/** Seed OpenSSL's random number generator with DIGEST_LEN bytes from the
+/** Seed OpenSSL's random number generator with bytes from the
  * operating system.  Return 0 on success, -1 on failure.
  */
 int
 crypto_seed_rng(void)
 {
+  char buf[64];
 #ifdef MS_WINDOWS
   static int provider_set = 0;
   static HCRYPTPROV provider;
-  char buf[DIGEST_LEN+1];
 
   if (!provider_set) {
     if (!CryptAcquireContext(&provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
@@ -1610,7 +1610,6 @@
   };
   int fd;
   int i, n;
-  char buf[DIGEST_LEN+1];
 
   for (i = 0; filenames[i]; ++i) {
     fd = open(filenames[i], O_RDONLY, 0);



More information about the tor-commits mailing list