Bug #67827 [NEW]: [PATCH] broken detection of system crypt sha256/sha512 support
| From: | ncopa at alpinelinux dot org | Date: | Tue, 12 Aug 2014 11:11:45 +0000 |
| Subject: | Bug #67827 [NEW]: [PATCH] broken detection of system crypt sha256/sha512 support | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-187090@lists.php.net to get a copy of this message | ||
From: ncopa at alpinelinux dot org
Operating system: Alpine Linux
PHP version: 5.5.15
Package: *Encryption and hash functions
Bug Type: Bug
Bug description:[PATCH] broken detection of system crypt sha256/sha512 support
Description:
------------
the configure script checks for sha256/sha512 support in system crypt(3)
and sucessfully finds it. But it will set PHP_SHA_CRYPT to 0 due to a
bad test and the result is that CRYPT_256 and CRYPT_512 constants are
wrong set to 0 in runtime.
This happens due to a uppercase vs lowercase mismatch in
ext/standard/config.m4:
It start with setting ac_vc_crypt_SHA512 (note uppercase SHA512)
AC_CACHE_CHECK(for SHA512 crypt, ac_cv_crypt_SHA512,[
...
}],[
ac_cv_crypt_SHA512=yes
],[
ac_cv_crypt_SHA512=no
],[
ac_cv_crypt_SHA512=no
])])
But some lines below it checks with lowercase $ac_cv_crypt_sha512:
if test "$ac_cv_crypt_sha512" = "yes"; then
ac_result=1
ac_crypt_sha512=1
else
ac_result=0
ac_crypt_sha512=0
fi
AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, $ac_result, [Whether the system
supports SHA512 salt])
And it wil end up setting PHP_SHA512_CRYPT to 0 even if we actually have
sha512 support. Same thing happens with sha256.
Test script:
---------------
echo CRYPT_SHA256."\n";
echo CRYPT_SHA512."\n";
Expected result:
----------------
1
Actual result:
--------------
0
--
Edit bug report at https://bugs.php.net/bug.php?id=67827&edit=1
--