From: Nikita Popov Date: Fri, 25 Mar 2016 19:37:17 +0000 (+0100) Subject: Ensure that all crypt() formats are supported X-Git-Tag: php-7.1.0alpha1~417 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a142c274fbc31b073a57e70f358d59e498753064;p=php Ensure that all crypt() formats are supported Checks for md5, sha512 and sha256 were missing. As a result the PHP_*_CRYPT constants are always 1 now. --- diff --git a/ext/standard/config.m4 b/ext/standard/config.m4 index f9afff30e6..36a11c436c 100644 --- a/ext/standard/config.m4 +++ b/ext/standard/config.m4 @@ -242,7 +242,7 @@ int main() { dnl dnl If one of them is missing, use our own implementation, portable code is then possible dnl -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 +if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test "$ac_cv_crypt_ext_des" = "no" || test "$ac_cv_crypt_md5" = "no" || test "$ac_cv_crypt_sha512" = "no" || test "$ac_cv_crypt_sha256" = "no" || test "x$php_crypt_r" = "x0"; then dnl dnl Check for __alignof__ support in the compiler @@ -278,72 +278,19 @@ if test "$ac_cv_crypt_blowfish" = "no" || test "$ac_cv_crypt_des" = "no" || test AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 1, [Whether PHP has to use its own crypt_r for blowfish, des, ext des and md5]) - AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, 1, [Whether the system supports standard DES salt]) - AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, 1, [Whether the system supports BlowFish salt]) - AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, 1, [Whether the system supports extended DES salt]) - AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports MD5 salt]) - AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, 1, [Whether the system supports SHA512 salt]) - AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, 1, [Whether the system supports SHA256 salt]) PHP_ADD_SOURCES(PHP_EXT_DIR(standard), crypt_freesec.c crypt_blowfish.c crypt_sha512.c crypt_sha256.c php_crypt_r.c) else - if test "$ac_cv_crypt_des" = "yes"; then - ac_result=1 - ac_crypt_des=1 - else - ac_result=0 - ac_crypt_des=0 - fi - AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, $ac_result, [Whether the system supports standard DES salt]) - - if test "$ac_cv_crypt_blowfish" = "yes"; then - ac_result=1 - ac_crypt_blowfish=1 - else - ac_result=0 - ac_crypt_blowfish=0 - fi - AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, $ac_result, [Whether the system supports BlowFish salt]) - - if test "$ac_cv_crypt_ext_des" = "yes"; then - ac_result=1 - ac_crypt_edes=1 - else - ac_result=0 - ac_crypt_edes=0 - fi - AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, $ac_result, [Whether the system supports extended DES salt]) - - if test "$ac_cv_crypt_md5" = "yes"; then - ac_result=1 - ac_crypt_md5=1 - else - ac_result=0 - ac_crypt_md5=0 - fi - AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, $ac_result, [Whether the system supports MD5 salt]) - - 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]) - - if test "$ac_cv_crypt_sha256" = "yes"; then - ac_result=1 - ac_crypt_sha256=1 - else - ac_result=0 - ac_crypt_sha256=0 - fi - AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, $ac_result, [Whether the system supports SHA256 salt]) - AC_DEFINE_UNQUOTED(PHP_USE_PHP_CRYPT_R, 0, [Whether PHP has to use its own crypt_r for blowfish, des and ext des]) fi +AC_DEFINE_UNQUOTED(PHP_STD_DES_CRYPT, 1, [Whether the system supports standard DES salt]) +AC_DEFINE_UNQUOTED(PHP_BLOWFISH_CRYPT, 1, [Whether the system supports BlowFish salt]) +AC_DEFINE_UNQUOTED(PHP_EXT_DES_CRYPT, 1, [Whether the system supports extended DES salt]) +AC_DEFINE_UNQUOTED(PHP_MD5_CRYPT, 1, [Whether the system supports MD5 salt]) +AC_DEFINE_UNQUOTED(PHP_SHA512_CRYPT, 1, [Whether the system supports SHA512 salt]) +AC_DEFINE_UNQUOTED(PHP_SHA256_CRYPT, 1, [Whether the system supports SHA256 salt]) + dnl dnl Check for available functions dnl