summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/config.m47
-rw-r--r--ext/standard/config.w323
-rw-r--r--ext/standard/password.c3
3 files changed, 13 insertions, 0 deletions
diff --git a/ext/standard/config.m4 b/ext/standard/config.m4
index 284e74e967..87ee059bd3 100644
--- a/ext/standard/config.m4
+++ b/ext/standard/config.m4
@@ -439,6 +439,13 @@ if test "$PHP_PASSWORD_ARGON2" != "no"; then
], [
AC_MSG_ERROR([Problem with libargon2.(a|so). Please verify that Argon2 header and libaries are installed])
])
+
+ AC_CHECK_LIB(argon2, argon2id_hash_raw, [
+ LIBS="$LIBS -largon2"
+ AC_DEFINE(HAVE_ARGON2ID, 1, [ Define to 1 if Argon2 library has support for Argon2ID])
+ ], [
+ AC_MSG_RESULT([not found])
+ ])
fi
dnl
diff --git a/ext/standard/config.w32 b/ext/standard/config.w32
index 00b2166abe..ee1935fe87 100644
--- a/ext/standard/config.w32
+++ b/ext/standard/config.w32
@@ -7,6 +7,9 @@ if (PHP_PASSWORD_ARGON2 != "no") {
if (CHECK_LIB("argon2_a.lib;argon2.lib", null, PHP_PASSWORD_ARGON2)
&& CHECK_HEADER_ADD_INCLUDE("argon2.h", "CFLAGS")) {
AC_DEFINE('HAVE_ARGON2LIB', 1);
+ if (CHECK_FUNC_IN_HEADER("argon2.h", "argon2id_hash_raw", PHP_PHP_BUILD + "\\include", "CFLAGS")) {
+ AC_DEFINE('HAVE_ARGON2ID', 1);
+ }
} else {
WARNING("Argon2 not enabled; libaries and headers not found");
}
diff --git a/ext/standard/password.c b/ext/standard/password.c
index 2d04badd1b..5e1704fe69 100644
--- a/ext/standard/password.c
+++ b/ext/standard/password.c
@@ -545,6 +545,9 @@ PHP_FUNCTION(password_hash)
threads,
(uint32_t)salt_len,
out_len
+#if HAVE_ARGON2ID
+ , type
+#endif
);
out = emalloc(out_len + 1);