Skip to content

Commit 1ef65c1

Browse files
committed
Clean up OpenSSL engine list when OpenSSL 1.0.2 used
Attempt to fix GH-8620.
1 parent 6b35850 commit 1ef65c1

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ PHP NEWS
1111
- MySQLnd:
1212
. Fixed potential heap corruption due to alignment mismatch. (cmb)
1313

14+
- OpenSSL:
15+
. Fixed missing clean up of OpenSSL engine list - attempt to fix GH-8620.
16+
(Jakub Zelenka)
17+
1418
- PDO_ODBC:
1519
. Fixed bug GH-9372 (HY010 when binding overlong parameter). (cmb)
1620

ext/openssl/openssl.c

+9
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
#include <openssl/param_build.h>
6262
#endif
6363

64+
#if OPENSSL_VERSION_NUMBER < 0x10100000L && !defined(OPENSSL_NO_ENGINE)
65+
#include <openssl/engine.h>
66+
#endif
67+
6468
/* Common */
6569
#include <time.h>
6670

@@ -1312,6 +1316,11 @@ PHP_MSHUTDOWN_FUNCTION(openssl)
13121316
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
13131317
EVP_cleanup();
13141318

1319+
#ifndef OPENSSL_NO_ENGINE
1320+
/* Free engine list initialized by OPENSSL_config */
1321+
ENGINE_cleanup();
1322+
#endif
1323+
13151324
/* prevent accessing locking callback from unloaded extension */
13161325
CRYPTO_set_locking_callback(NULL);
13171326
/* free allocated error strings */

0 commit comments

Comments
 (0)