[imp] Configuring PesudoRandom device

Chuck Hagenbuch chuck@horde.org
Fri, 17 Nov 2000 23:33:29 -0500


Quoting Marc Giannoni <marc@archela.com>:

> Chasing this one down lead me to some code in "ext/mcrypt.c"
> where the second parameter to "mcrypt_create_iv()" appears to 
> determine the type of random generator to use:
> 
> 0 = /dev/random
> 1 = /dev/urandom
> 2 = rand()
> 
> I don't have "/dev/random" -or- "/dev/urandom" on my Solaris-2.7 
> platform, so I'll probably have to add a patch form SUN.  For now,
> I just "hacked" the second parameter of "mcrypt_create_iv()" to "2"
> which has solved this problem!
> 
> So My REAL question is:
> 
> Is there an IMP/HORDE config for choosing the random number generator,
> or is this a bug in "ext/mcrypt.c", or is this a PHP-4 configuration?
> I haven't located the "MCRYPT_BLOWFISH" define, but it appears to me to 
> be place here by mistake.

Looks like I got some constants confused. I've changed it to MCRYPT_RAND (with a
call to srand()), and it seems to be still working fine here - give it a shot.

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
"If you can't stand the heat, get out of the chicken!" - Baby Blues