[php-src] PHP-8.5: Fix GH-20920: guard ENGINE_cleanup() with OPENSSL_NO_ENGINE again

From: Date: Tue, 24 Nov 2026 12:09:53 +0000
Subject: [php-src] PHP-8.5: Fix GH-20920: guard ENGINE_cleanup() with OPENSSL_NO_ENGINE again
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-144098@lists.php.net to get a copy of this message
Author: Eugene Gvozdetsky (gvozdetsky) Committer: Jakub Zelenka (bukka) Date: 2026-11-24T12:39:05+01:00 Commit: https://github.com/php/php-src/commit/cdbba57ec951251bd1cddfbed6467b7cee7c22dc Raw diff: https://github.com/php/php-src/commit/cdbba57ec951251bd1cddfbed6467b7cee7c22dc.diff Fix GH-20920: guard ENGINE_cleanup() with OPENSSL_NO_ENGINE again The call was guarded by #ifndef OPENSSL_NO_ENGINE until the v1/v3 backend split in d662ab5f08a moved it from ext/openssl/openssl.c into ext/openssl/openssl_backend_v1.c, where only the surrounding #ifdef LIBRESSL_VERSION_NUMBER was kept. LibreSSL defines OPENSSL_NO_ENGINE, so <openssl/engine.h> is not included and ENGINE_cleanup() ends up being called without a prototype. That is a warning with older compilers and an error with GCC 14 and later, which default to C23. Restore the guard so that the call matches the condition of its include. Closes GH-23689 Changed paths: M ext/openssl/openssl_backend_v1.c Diff: diff --git a/ext/openssl/openssl_backend_v1.c b/ext/openssl/openssl_backend_v1.c index 13aab24c3ff0..235344b22a5f 100644 --- a/ext/openssl/openssl_backend_v1.c +++ b/ext/openssl/openssl_backend_v1.c @@ -51,8 +51,10 @@ void php_openssl_backend_shutdown(void) /* prevent accessing locking callback from unloaded extension */ CRYPTO_set_locking_callback(NULL); +#ifndef OPENSSL_NO_ENGINE /* Free engine list initialized by OPENSSL_config */ ENGINE_cleanup(); +#endif /* free allocated error strings */ ERR_free_strings();

« previous php.cvs (#144098) next »