On Thu, Dec 20, 2001 at 11:29:43AM -0600, William A. Rowe, Jr. wrote:
> I'll see your +1 and double :)
>
> Yes - perhaps the MPM itself should generate ap_server_entropy.
FWIW, DougM submitted this function to flood to generate OpenSSL
entropy. I'd almost suggest somehow factoring this into apr-util
since flood needs this too (and doesn't have a scoreboard).
However, that'd require linking against OpenSSL in apr-util which
may be a no-no.
I wonder what ways we could do this though (some reason I'm
thinking as a nasty #define)? But, there is a definite value to
merging the implementations. -- justin
static void load_rand(void)
{
unsigned char stackdata[256];
time_t tt;
pid_t pid;
int l, n;
tt = time(NULL);
l = sizeof(time_t);
RAND_seed((unsigned char *)&tt, l);
pid = (pid_t)getpid();
l = sizeof(pid_t);
RAND_seed((unsigned char *)&pid, l);
n = ssl_rand_choosenum(0, sizeof(stackdata)-128-1);
RAND_seed(stackdata+n, 128);
}