You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apache-bugdb@apache.org by Dirk-Willem van Gulik <di...@webweaving.org> on 1999/09/08 18:20:01 UTC

Re: mod_auth-any/4967: Can't read from /dev/random (fwd)

The following reply was made to PR mod_auth-any/4967; it has been noted by GNATS.

From: Dirk-Willem van Gulik <di...@webweaving.org>
To: "Life is hard, and then you die." <ro...@innovation.ch>
Cc: apbugs@apache.org
Subject: Re: mod_auth-any/4967: Can't read from /dev/random (fwd)
Date: Wed, 8 Sep 1999 18:15:34 +0200 (CEST)

 On Wed, 8 Sep 1999, Life is hard, and then you die. wrote:
 
 ...
 
 > I think I got it now. Yes, random(4) seems to be non-blocking, returning
 > 0 bytes when not enough entropy is available. The problem is that when
 > you use the stdio stuff fread() interprets a return of 0 as EOF, sets
 > its internal EOF flag, and then always returns 0 and never goes to the
 > underlying read() again. Hence the problem.
 
 Yep, that sounds correct.. you worded it better than me. This was what I
 was trying to convey.
  
 > Well, ok, I'll have to change to raw read as suggested in the report.
 
 Hmm.. let's see. You propably are doing a read for _each_ and every child
 as you are starting up.. whichis propably why the random(4) gets exhausted
 so quickly during server init.
 
 Now all we require is an unpredictable number. It does not need to be
 random at all. Perhaps during initial config we can _once_ read the value
 and then use a one way function, say md5, to seed each child on the second
 init of the actual forked of processes; just adding a few bits (say the
 PID) is enough as long as the function is one way enough. MD5 should be.
 
 Dw