php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #51435 Missing ifdefs / logic bug in crypt code cause compile errors
Submitted: 2010-03-30 12:05 UTC Modified: 2010-04-22 22:54 UTC
From: joey@php.net Assigned: felipe (profile)
Status: Closed Package: Compile Failure
PHP Version: 5.3.2 OS: Ubuntu 9.10
Private report: No CVE-ID: None
 [2010-03-30 12:05 UTC] joey@php.net
Description:
------------
In ext/standard/config.m4, the following line causes conditional definition of the PHP_SHA256_CRYPT and PHP_SHA512_CRYPT constants:

if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "x$php_crypt_r" = "x0"; then

Because these symbols are used unconditionally in ext/standard/crypt.c, this can cause PHP to fail to compile.

In the near-term, the compile bug can be fixed as follows:


#ifdef PHP_SHA256_CRYPT
   REGISTER_LONG_CONSTANT("CRYPT_SHA256", PHP_SHA256_CRYPT, CONST_CS | CONST_PERSISTENT);
#endif
#ifdef PHP_SHA512_CRYPT
   REGISTER_LONG_CONSTANT("CRYPT_SHA512", PHP_SHA512_CRYPT, CONST_CS | CONST_PERSISTENT);
#endif


However, the m4 logic should probably be revisited at some point.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-04-22 22:54 UTC] felipe@php.net
Automatic comment from SVN on behalf of felipe
Revision: http://svn.php.net/viewvc/?view=revision&revision=298345
Log: - Fixed bug #51435 (Missing ifdefs / logic bug in crypt code cause compile errors)
 [2010-04-22 22:54 UTC] felipe@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: felipe
 [2010-04-22 22:54 UTC] felipe@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 08:01:29 2024 UTC