Skip to content

Commit d476cf2

Browse files
cmb69petk
andcommitted
Support --with-openssl-argon2 on Windows
We change the error for ZTS builds to a warning, to not break snapshot builds which automatically will try to enable OpenSSL password hashing. We also change some messages to better fit building on Windows. And of course, we cannot easily check whether `OSSL_set_max_threads()` is actually available; instead we're looking up the function declaration in its header file. Co-authored-by: Peter Kokot <[email protected]>
1 parent 45ebe47 commit d476cf2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/openssl/config.w32

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,22 @@
22

33
ARG_WITH("openssl", "OpenSSL support", "no,shared");
44

5+
ARG_WITH("openssl-argon2", "OPENSSL: Enable argon2 password hashing (requires OpenSSL >= 3.2)", "no");
6+
57
if (PHP_OPENSSL != "no") {
68
var ret = SETUP_OPENSSL("openssl", PHP_OPENSSL);
79

810
if (ret >= 2) {
9-
EXTENSION("openssl", "openssl.c xp_ssl.c");
11+
EXTENSION("openssl", "openssl.c openssl_pwhash.c xp_ssl.c");
1012
AC_DEFINE("HAVE_OPENSSL_EXT", 1, "Define to 1 if the PHP extension 'openssl' is available.");
13+
if (PHP_OPENSSL_ARGON2 != "no") {
14+
if (PHP_ZTS != "no") {
15+
WARNING("OpenSSL argon2 hashing not supported in ZTS mode for now");
16+
} else if (!CHECK_FUNC_IN_HEADER("openssl/thread.h", "OSSL_set_max_threads", PHP_PHP_BUILD + "\\include")) {
17+
WARNING("OpenSSL argon2 hashing requires OpenSSL >= 3.2");
18+
} else {
19+
AC_DEFINE("HAVE_OPENSSL_ARGON2", 1, "Define to 1 to enable OpenSSL argon2 password hashing.");
20+
}
21+
}
1122
}
1223
}

0 commit comments

Comments
 (0)