Skip to content

Commit 636f843

Browse files
committed
Implement GH-13514 PASSWORD_ARGON2 from OpenSSL 3.2
1 parent 540e37f commit 636f843

File tree

9 files changed

+654
-4
lines changed

9 files changed

+654
-4
lines changed

ext/openssl/config0.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ PHP_ARG_WITH([system-ciphers],
1818
[no])
1919

2020
if test "$PHP_OPENSSL" != "no"; then
21-
PHP_NEW_EXTENSION(openssl, openssl.c xp_ssl.c, $ext_shared)
21+
PHP_NEW_EXTENSION(openssl, openssl.c openssl_pwhash.c xp_ssl.c, $ext_shared)
2222
PHP_SUBST(OPENSSL_SHARED_LIBADD)
2323

2424
if test "$PHP_KERBEROS" != "no"; then

ext/openssl/openssl.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,9 +263,20 @@ static void php_openssl_pkey_free_obj(zend_object *object)
263263
zend_object_std_dtor(&key_object->std);
264264
}
265265

266+
#if PHP_OPENSSL_API_VERSION >= 0x30200
267+
static const zend_module_dep openssl_deps[] = {
268+
ZEND_MOD_REQUIRED("standard")
269+
ZEND_MOD_END
270+
};
271+
#endif
266272
/* {{{ openssl_module_entry */
267273
zend_module_entry openssl_module_entry = {
274+
#if PHP_OPENSSL_API_VERSION >= 0x30200
275+
STANDARD_MODULE_HEADER_EX, NULL,
276+
openssl_deps,
277+
#else
268278
STANDARD_MODULE_HEADER,
279+
#endif
269280
"openssl",
270281
ext_functions,
271282
PHP_MINIT(openssl),
@@ -1321,6 +1332,12 @@ PHP_MINIT_FUNCTION(openssl)
13211332

13221333
REGISTER_INI_ENTRIES();
13231334

1335+
#if PHP_OPENSSL_API_VERSION >= 0x30200
1336+
if (FAILURE == PHP_MINIT(openssl_pwhash)(INIT_FUNC_ARGS_PASSTHRU)) {
1337+
return FAILURE;
1338+
}
1339+
#endif
1340+
13241341
return SUCCESS;
13251342
}
13261343
/* }}} */

0 commit comments

Comments
 (0)