Skip to content

Commit d2234b8

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 6732b88 commit d2234b8

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

ext/openssl/config.w32

+12-1
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@ ARG_WITH("openssl", "OpenSSL support", "no,shared");
44

55
ARG_WITH("openssl-legacy-provider", "OPENSSL: Load legacy algorithm provider in addition to default provider", "no");
66

7+
ARG_WITH("openssl-argon2", "OPENSSL: Enable argon2 password hashing (requires OpenSSL >= 3.2)", "no");
8+
79
if (PHP_OPENSSL != "no") {
810
var ret = SETUP_OPENSSL("openssl", PHP_OPENSSL);
911

1012
if (ret >= 2) {
11-
EXTENSION("openssl", "openssl.c xp_ssl.c");
13+
EXTENSION("openssl", "openssl.c openssl_pwhash.c xp_ssl.c");
1214
AC_DEFINE("HAVE_OPENSSL_EXT", 1, "Define to 1 if the PHP extension 'openssl' is available.");
1315
if (PHP_OPENSSL_LEGACY_PROVIDER != "no") {
1416
AC_DEFINE("LOAD_OPENSSL_LEGACY_PROVIDER", 1, "Define to 1 to load the OpenSSL legacy algorithm provider in addition to the default provider.");
1517
}
18+
if (PHP_OPENSSL_ARGON2 != "no") {
19+
if (PHP_ZTS != "no") {
20+
WARNING("OpenSSL argon2 hashing not supported in ZTS mode for now");
21+
} else if (!CHECK_FUNC_IN_HEADER("openssl/thread.h", "OSSL_set_max_threads", PHP_PHP_BUILD + "\\include")) {
22+
WARNING("OpenSSL argon2 hashing requires OpenSSL >= 3.2");
23+
} else {
24+
AC_DEFINE("HAVE_OPENSSL_ARGON2", 1, "Define to 1 to enable OpenSSL argon2 password hashing.");
25+
}
26+
}
1627
}
1728
}

0 commit comments

Comments
 (0)