|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp-fix-crypt-sha512-v2.patch (last revision 2014-08-14 11:10 UTC by ncopa at alpinelinux dot org)php-fix-crypt-sha512.patch (last revision 2014-08-12 11:12 UTC by ncopa at alpinelinux dot org) Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-14 06:54 UTC] fa@php.net
[2014-08-14 10:10 UTC] ncopa at alpinelinux dot org
[2014-08-14 14:00 UTC] fuxuxuxuxuxx at yopmail dot com
[2015-02-17 03:14 UTC] felipe@php.net
[2015-02-17 03:14 UTC] felipe@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
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