diff options
author | Remi Collet <remi@remirepo.net> | 2024-08-28 16:16:35 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2024-08-28 16:16:35 +0200 |
commit | 80fdfd87f89ddf1640b05c561cae74c6fac51472 (patch) | |
tree | d4da2b687b1d1a5bb318619fd0925434ef4751a6 | |
parent | 284a17d46f865e819f2520da9b536c51ca24d54a (diff) |
requires libxcrypt >= 4.4
-rw-r--r-- | README.md | 3 | ||||
-rw-r--r-- | config.m4 | 18 | ||||
-rw-r--r-- | package.xml | 10 | ||||
-rw-r--r-- | php_xpass.h | 2 | ||||
-rw-r--r-- | xpass.c | 2 |
5 files changed, 19 insertions, 16 deletions
@@ -22,7 +22,10 @@ Notices: these are fast, don't expect high security level. # Build +Compatible with PHP 8.0 or greater. + You need the Extended crypt library development files (libxcrypt-devel) +version 4.4 or greater. From the sources tree @@ -7,14 +7,14 @@ PHP_ARG_ENABLE([xpass], [no]) if test "$PHP_XPASS" != "no"; then - PKG_CHECK_MODULES([LIBXCRYPT], [libxcrypt]) - PHP_EVAL_INCLINE($LIBXCRYPT_CFLAGS) - PHP_EVAL_LIBLINE($LIBXCRYPT_LIBS, XPASS_SHARED_LIBADD) + PKG_CHECK_MODULES([LIBXCRYPT], [libxcrypt >= 4.4]) + PHP_EVAL_INCLINE([$LIBXCRYPT_CFLAGS]) + PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD]) old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS" old_LDFLAGS=$CFLAGS; LDFLAGS="$CFLAGS $LIBXCRYPT_LIBS" - AC_MSG_CHECKING(for yescrypt) + AC_MSG_CHECKING([for yescrypt]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <string.h> #include <unistd.h> @@ -27,13 +27,13 @@ int main(void) { salt[0]='$'; salt[1]='y'; salt[2]='$'; salt[3]=0; return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; }]])],[ - AC_DEFINE(HAVE_CRYPT_YESCRYPT, 1, [ Have yescrypt hash support ]) + AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ]) AC_MSG_RESULT([available]) ], [ AC_MSG_RESULT([missing]) ]) - AC_MSG_CHECKING(for sha512) + AC_MSG_CHECKING([for sha512 algo]) AC_RUN_IFELSE([AC_LANG_SOURCE([[ #include <string.h> #include <unistd.h> @@ -46,7 +46,7 @@ int main(void) { salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]=0; return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1; }]])],[ - AC_DEFINE(HAVE_CRYPT_SHA512, 1, [ Have sha512 hash support ]) + AC_DEFINE([HAVE_CRYPT_SHA512], [1], [ Have sha512 hash support ]) AC_MSG_RESULT([available]) ], [ AC_MSG_RESULT([missing]) @@ -55,9 +55,9 @@ int main(void) { CFLAGS=$old_CFLAGS LDFLAGS=$old_LDFLAGS - PHP_SUBST(XPASS_SHARED_LIBADD) + PHP_SUBST([XPASS_SHARED_LIBADD]) - AC_DEFINE(HAVE_XPASS, 1, [ Have xpass support ]) + AC_DEFINE([HAVE_XPASS], [1], [ Have xpass support ]) PHP_NEW_EXTENSION(xpass, xpass.c, $ext_shared) fi diff --git a/package.xml b/package.xml index ca7d161..0dca32d 100644 --- a/package.xml +++ b/package.xml @@ -4,8 +4,8 @@ <channel>pecl.php.net</channel> <summary>Extended password extension</summary> <description> -This extension provides password hashing algorithms used by Linux distributions, -using extended crypt library (libxcrypt). +This extension provides password hashing algorithms used by Linux +distributions, using extended crypt library (libxcrypt). * sha512 provided for legacy as used on some old distributions * yescrypt used on modern distributions @@ -16,13 +16,13 @@ using extended crypt library (libxcrypt). <email>remi@php.net</email> <active>yes</active> </lead> - <date>2024-08-27</date> + <date>2024-08-28</date> <version> - <release>1.0.0dev</release> + <release>1.0.0RC1</release> <api>1.0.0</api> </version> <stability> - <release>stable</release> + <release>beta</release> <api>stable</api> </stability> <license uri="https://www.php.net/license/3_01.txt" filesource="LICENSE">PHP-3.01</license> diff --git a/php_xpass.h b/php_xpass.h index 0bb441f..5d889c4 100644 --- a/php_xpass.h +++ b/php_xpass.h @@ -22,7 +22,7 @@ extern zend_module_entry xpass_module_entry; #define phpext_xpass_ptr &xpass_module_entry -#define PHP_XPASS_VERSION "1.0.0-dev" +#define PHP_XPASS_VERSION "1.0.0RC1" #define PHP_XPASS_AUTHOR "Remi Collet" #define PHP_XPASS_LICENSE "PHP-3.01" @@ -124,7 +124,7 @@ static bool php_xpass_verify(const zend_string *password, const zend_string *has static bool php_xpass_needs_rehash(const zend_string *hash, zend_array *options) { - if (crypt_checksalt(ZSTR_VAL(hash))) { + if (crypt_checksalt(ZSTR_VAL(hash)) != CRYPT_SALT_OK) { return 1; } return 0; |