Full_Name: Charles Jardine
Version: 2.8.4
OS: Solaris 8
Submission from: (NULL) (131.111.8.103)


While trussing my Apache to trace another problem, I noticed
reads of 8k bytes from /dev/urandom. My configuration has

  SSLRandomSeed connect file:/dev/urandom 32

so I was hoping for reads of 32 bytes.

The cause of the profilgate use of /dev/urandom is stdio
read-ahead. The code is using fread to read 32 bytes, but
fread is buffered, and 8k bytes are read.

I have tested the following patch. It fixes the problem,
but at the expense of single-byte reads.

*** ssl_engine_rand.c.orig      Mon Jan  1 10:48:58 2001
--- ssl_engine_rand.c   Tue Dec 11 15:58:03 2001
***************
*** 102,107 ****
--- 102,108 ----
                   */
                  if ((fp = ap_pfopen(p, pRandSeed->cpPath, "r")) == NULL)
                      continue;
+                 setbuf(fp, NULL);
                  nDone += ssl_rand_feedfp(p, fp, pRandSeed->nBytes);
                  ap_pfclose(p, fp);
              }

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      [EMAIL PROTECTED]
Automated List Manager                            [EMAIL PROTECTED]

Reply via email to