Bug #8834 Updated: crypt() starts from not random salt
| From: | sniper@php.net | Date: | Sun, 06 May 2001 16:56:47 +0000 |
| Subject: | Bug #8834 Updated: crypt() starts from not random salt | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-54130@lists.php.net to get a copy of this message | ||
ID: 8834
Updated by: sniper
Reported By: muhlig@us.edu.pl
Old-Status: Open
Status: Closed
Bug Type: *Encryption and hash functions
Operating system:
PHP Version: 4.0 Latest CVS (22/01/2001)
Assigned To:
Comments:
This should be fixed in CVS now. Please try it out.
Reopen if still not random..
--Jani
Previous Comments:
---------------------------------------------------------------------------
[2001-04-05 16:03:09] muhlig@us.edu.pl
here you are:
Solaris 2.4:
# grep RAND main/php_config.h
#define HAVE_LRAND48 1
#define HAVE_RAND_R 1
/* #undef HAVE_RANDOM */
#define HAVE_SRAND48 1
/* #undef HAVE_SRANDOM */
# uname -a
SunOS helios 5.4 Generic_101945-60 sun4d sparc
#
Solaris 2.6
# grep RAND main/php_config.h
#define HAVE_LRAND48 1
#define HAVE_RAND_R 1
#define HAVE_RANDOM 1
#define HAVE_SRAND48 1
#define HAVE_SRANDOM 1
# uname -a
SunOS uranos 5.6 Generic_105181-21 sun4u sparc SUNW,Ultra-4
#
unfortunately I'm not able to discuss the solution, although I can test the one provided :-)),
thank you
---------------------------------------------------------------------------
[2001-04-05 15:14:41] muhlig@us.edu.pl
here you are:
Solaris 2.4:
# grep RAND main/php_config.h
#define HAVE_LRAND48 1
#define HAVE_RAND_R 1
/* #undef HAVE_RANDOM */
#define HAVE_SRAND48 1
/* #undef HAVE_SRANDOM */
# uname -a
SunOS helios 5.4 Generic_101945-60 sun4d sparc
#
Solaris 2.6
# grep RAND main/php_config.h
#define HAVE_LRAND48 1
#define HAVE_RAND_R 1
#define HAVE_RANDOM 1
#define HAVE_SRAND48 1
#define HAVE_SRANDOM 1
# uname -a
SunOS uranos 5.6 Generic_105181-21 sun4u sparc SUNW,Ultra-4
#
unfortunately I'm not able to discuss the solution, although I can test the one provided :-)),
thank you
---------------------------------------------------------------------------
[2001-04-05 14:57:44] sniper@php.net
This is most likely a Solaris specific issue as I can't
reproduce this on Linux.
Can you please include the output of this command in both
Solaris 2.4 and 2.6 (in php4):
# grep RAND main/php_config.h
It might be that in both of those system the seed generator
found is srand() which isn't so good as srandom() is.
But I also found (with google :) that srandom() might not be
that good either (in Solaris) so that leaves us with a problem.
One solution might be that we run php_srand() in RINIT instead of MINIT when Solaris is used.
--Jani
---------------------------------------------------------------------------
[2001-01-22 06:05:34] muhlig@us.edu.pl
PHP compiled as Apache module. Look like crypt() starts from not random salt. In case of my Solaris
2.4, first crypt() call always generates string starting from "IH". In case of Solaris 2.6
it always starts from "C.".
Looks like in every instantiation of new Apache process PHP starts crypt from the same salt value.
In the same process next crypt() calls look like they generate random strings, though. But next
process restarts with the same value.
---------------------------------------------------------------------------
ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=8834&edit=2