@@ -12,40 +12,34 @@ if test "$PHP_XPASS" != "no"; then
12
12
PHP_EVAL_LIBLINE([ $LIBXCRYPT_LIBS] , [ XPASS_SHARED_LIBADD] )
13
13
14
14
old_CFLAGS=$CFLAGS; CFLAGS="$CFLAGS $LIBXCRYPT_CFLAGS"
15
- old_LDFLAGS=$LDFLAGS; LDFLAGS ="$LIBXCRYPT_LIBS $LDFLAGS "
15
+ old_LIBS="$LIBS"; LIBS ="$LIBXCRYPT_LIBS"
16
16
17
17
AC_MSG_CHECKING ( [ for yescrypt] )
18
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
19
- #include <string.h>
20
- #include <unistd.h>
21
- #include <crypt.h>
22
- #include <stdlib.h>
23
- #include <string.h>
24
-
25
- int main(void) {
26
- char salt[ 8] ;
27
- salt[ 0] ='$'; salt[ 1] ='y'; salt[ 2] ='$'; salt[ 3] =0;
28
- return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
29
- }] ] ) ] ,[
30
- AC_DEFINE ( [ HAVE_CRYPT_YESCRYPT] , [ 1] , [ Have yescrypt hash support ] )
31
- AC_MSG_RESULT ( [ available] )
18
+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
19
+ #include <crypt.h>
20
+ #include <string.h>
21
+ ] ] , [ [
22
+ struct crypt_data data;
23
+ memset(&data, 0, sizeof(data));
24
+ char *result = crypt_r("password", "$y$", &data);
25
+ return (result != NULL && strncmp(result, "$y$", 3) == 0) ? 0 : 1;
26
+ ] ] ) ] , [
27
+ AC_MSG_RESULT ( [ available] )
28
+ AC_DEFINE ( [ HAVE_CRYPT_YESCRYPT] , [ 1] , [ Define if libxcrypt supports SHA512] )
32
29
] , [
33
- AC_MSG_RESULT ( [ missing] )
30
+ AC_MSG_RESULT ( [ missing] )
34
31
] )
35
32
36
33
AC_MSG_CHECKING ( [ for sha512 algo] )
37
- AC_RUN_IFELSE ( [ AC_LANG_SOURCE ( [ [
38
- #include <string.h>
39
- #include <unistd.h>
40
- #include <crypt.h>
41
- #include <stdlib.h>
42
- #include <string.h>
43
-
44
- int main(void) {
45
- char salt[ 8] ;
46
- salt[ 0] ='$'; salt[ 1] ='6'; salt[ 2] ='$'; salt[ 3] =0;
47
- return crypt_gensalt(salt, 0, NULL, 0) ? 0 : 1;
48
- }] ] ) ] ,[
34
+ AC_LINK_IFELSE ( [ AC_LANG_PROGRAM ( [ [
35
+ #include <crypt.h>
36
+ #include <string.h>
37
+ ] ] , [ [
38
+ struct crypt_data data;
39
+ memset(&data, 0, sizeof(data));
40
+ char *result = crypt_r("password", "$6 $salt", &data);
41
+ return (result != NULL && strncmp(result, "$6 $", 3) == 0) ? 0 : 1;
42
+ ] ] ) ] ,[
49
43
AC_DEFINE ( [ HAVE_CRYPT_SHA512] , [ 1] , [ Have sha512 hash support ] )
50
44
AC_MSG_RESULT ( [ available] )
51
45
] , [
0 commit comments