Skip to content

Commit 2c89110

Browse files
committed
simplify init/shutdown
1 parent 6579dd1 commit 2c89110

7 files changed

+43
-62
lines changed

ext/openssl/openssl.c

-5
Original file line numberDiff line numberDiff line change
@@ -1412,11 +1412,6 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
14121412
php_stream_xport_unregister("tlsv1.3");
14131413
#endif
14141414

1415-
#if PHP_OPENSSL_API_VERSION >= 0x30200
1416-
if (FAILURE == PHP_MSHUTDOWN(openssl_pwhash)(SHUTDOWN_FUNC_ARGS_PASSTHRU)) {
1417-
return FAILURE;
1418-
}
1419-
#endif
14201415
/* reinstate the default tcp handler */
14211416
php_stream_xport_register("tcp", php_stream_generic_socket_factory);
14221417

ext/openssl/openssl.stub.php

+5
Original file line numberDiff line numberDiff line change
@@ -658,3 +658,8 @@ function openssl_spki_export_challenge(string $spki): string|false {}
658658
* @refcount 1
659659
*/
660660
function openssl_get_cert_locations(): array {}
661+
662+
#if PHP_OPENSSL_API_VERSION >= 0x30200
663+
function openssl_password_hash(string $algo, #[\SensitiveParameter] string $password, array $options = []): string {}
664+
function openssl_password_verify(string $algo, #[\SensitiveParameter] string $password, string $hash): bool {}
665+
#endif

ext/openssl/openssl_arginfo.h

+37-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/openssl/openssl_pwhash.c

-9
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ PHP_MINIT_FUNCTION(openssl_pwhash)
383383
{
384384
zend_string *argon2i = ZSTR_INIT_LITERAL("argon2i", 1);
385385

386-
zend_register_functions(NULL, ext_functions, NULL, type);
387-
388386
if (php_password_algo_find(argon2i)) {
389387
/* Nothing to do. Core or sodium has registered these algorithms for us. */
390388
zend_string_release(argon2i);
@@ -403,11 +401,4 @@ PHP_MINIT_FUNCTION(openssl_pwhash)
403401

404402
return SUCCESS;
405403
}
406-
407-
PHP_MSHUTDOWN_FUNCTION(openssl_pwhash)
408-
{
409-
zend_unregister_functions(ext_functions, -1, NULL);
410-
411-
return SUCCESS;
412-
}
413404
#endif /* PHP_OPENSSL_API_VERSION >= 0x30200 */

ext/openssl/openssl_pwhash.stub.php

-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,5 @@
3030
* @var string
3131
*/
3232
const PASSWORD_ARGON2_PROVIDER = "openssl";
33-
34-
function openssl_password_hash(string $algo, #[\SensitiveParameter] string $password, array $options = []): string {}
35-
function openssl_password_verify(string $algo, #[\SensitiveParameter] string $password, string $hash): bool {}
3633
#endif
3734

ext/openssl/openssl_pwhash_arginfo.h

+1-43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/openssl/php_openssl.h

-1
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ PHP_GINIT_FUNCTION(openssl);
193193
PHP_GSHUTDOWN_FUNCTION(openssl);
194194
#if PHP_OPENSSL_API_VERSION >= 0x30200
195195
PHP_MINIT_FUNCTION(openssl_pwhash);
196-
PHP_MSHUTDOWN_FUNCTION(openssl_pwhash);
197196
#endif
198197

199198
#ifdef PHP_WIN32

0 commit comments

Comments
 (0)