Skip to content

Commit 80fdfd8

Browse files
committed
requires libxcrypt >= 4.4
1 parent 284a17d commit 80fdfd8

File tree

5 files changed

+19
-16
lines changed

5 files changed

+19
-16
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ Notices: these are fast, don't expect high security level.
2222

2323
# Build
2424

25+
Compatible with PHP 8.0 or greater.
26+
2527
You need the Extended crypt library development files (libxcrypt-devel)
28+
version 4.4 or greater.
2629

2730
From the sources tree
2831

config.m4

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ PHP_ARG_ENABLE([xpass],
77
[no])
88

99
if test "$PHP_XPASS" != "no"; then
10-
PKG_CHECK_MODULES([LIBXCRYPT], [libxcrypt])
11-
PHP_EVAL_INCLINE($LIBXCRYPT_CFLAGS)
12-
PHP_EVAL_LIBLINE($LIBXCRYPT_LIBS, XPASS_SHARED_LIBADD)
10+
PKG_CHECK_MODULES([LIBXCRYPT], [libxcrypt >= 4.4])
11+
PHP_EVAL_INCLINE([$LIBXCRYPT_CFLAGS])
12+
PHP_EVAL_LIBLINE([$LIBXCRYPT_LIBS], [XPASS_SHARED_LIBADD])
1313

1414
old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS"
1515
old_LDFLAGS=$CFLAGS; LDFLAGS="$CFLAGS $LIBXCRYPT_LIBS"
1616

17-
AC_MSG_CHECKING(for yescrypt)
17+
AC_MSG_CHECKING([for yescrypt])
1818
AC_RUN_IFELSE([AC_LANG_SOURCE([[
1919
#include <string.h>
2020
#include <unistd.h>
@@ -27,13 +27,13 @@ int main(void) {
2727
salt[0]='$'; salt[1]='y'; salt[2]='$'; salt[3]=0;
2828
return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
2929
}]])],[
30-
AC_DEFINE(HAVE_CRYPT_YESCRYPT, 1, [ Have yescrypt hash support ])
30+
AC_DEFINE([HAVE_CRYPT_YESCRYPT], [1], [ Have yescrypt hash support ])
3131
AC_MSG_RESULT([available])
3232
], [
3333
AC_MSG_RESULT([missing])
3434
])
3535

36-
AC_MSG_CHECKING(for sha512)
36+
AC_MSG_CHECKING([for sha512 algo])
3737
AC_RUN_IFELSE([AC_LANG_SOURCE([[
3838
#include <string.h>
3939
#include <unistd.h>
@@ -46,7 +46,7 @@ int main(void) {
4646
salt[0]='$'; salt[1]='6'; salt[2]='$'; salt[3]=0;
4747
return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
4848
}]])],[
49-
AC_DEFINE(HAVE_CRYPT_SHA512, 1, [ Have sha512 hash support ])
49+
AC_DEFINE([HAVE_CRYPT_SHA512], [1], [ Have sha512 hash support ])
5050
AC_MSG_RESULT([available])
5151
], [
5252
AC_MSG_RESULT([missing])
@@ -55,9 +55,9 @@ int main(void) {
5555
CFLAGS=$old_CFLAGS
5656
LDFLAGS=$old_LDFLAGS
5757

58-
PHP_SUBST(XPASS_SHARED_LIBADD)
58+
PHP_SUBST([XPASS_SHARED_LIBADD])
5959

60-
AC_DEFINE(HAVE_XPASS, 1, [ Have xpass support ])
60+
AC_DEFINE([HAVE_XPASS], [1], [ Have xpass support ])
6161

6262
PHP_NEW_EXTENSION(xpass, xpass.c, $ext_shared)
6363
fi

package.xml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<channel>pecl.php.net</channel>
55
<summary>Extended password extension</summary>
66
<description>
7-
This extension provides password hashing algorithms used by Linux distributions,
8-
using extended crypt library (libxcrypt).
7+
This extension provides password hashing algorithms used by Linux
8+
distributions, using extended crypt library (libxcrypt).
99

1010
* sha512 provided for legacy as used on some old distributions
1111
* yescrypt used on modern distributions
@@ -16,13 +16,13 @@ using extended crypt library (libxcrypt).
1616
<email>[email protected]</email>
1717
<active>yes</active>
1818
</lead>
19-
<date>2024-08-27</date>
19+
<date>2024-08-28</date>
2020
<version>
21-
<release>1.0.0dev</release>
21+
<release>1.0.0RC1</release>
2222
<api>1.0.0</api>
2323
</version>
2424
<stability>
25-
<release>stable</release>
25+
<release>beta</release>
2626
<api>stable</api>
2727
</stability>
2828
<license uri="https://www.php.net/license/3_01.txt" filesource="LICENSE">PHP-3.01</license>

php_xpass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
extern zend_module_entry xpass_module_entry;
2323
#define phpext_xpass_ptr &xpass_module_entry
2424

25-
#define PHP_XPASS_VERSION "1.0.0-dev"
25+
#define PHP_XPASS_VERSION "1.0.0RC1"
2626
#define PHP_XPASS_AUTHOR "Remi Collet"
2727
#define PHP_XPASS_LICENSE "PHP-3.01"
2828

xpass.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static bool php_xpass_verify(const zend_string *password, const zend_string *has
124124

125125
static bool php_xpass_needs_rehash(const zend_string *hash, zend_array *options) {
126126

127-
if (crypt_checksalt(ZSTR_VAL(hash))) {
127+
if (crypt_checksalt(ZSTR_VAL(hash)) != CRYPT_SALT_OK) {
128128
return 1;
129129
}
130130
return 0;

0 commit comments

Comments
 (0)