com php-src: Do not explicitly initialize and clean up OpenSSL for OpenSSL 1.1: ext/openssl/openssl.c
| From: | Jakub Zelenka | Date: | Wed, 30 Aug 2017 16:29:24 +0000 |
| Subject: | com php-src: Do not explicitly initialize and clean up OpenSSL for OpenSSL 1.1: ext/openssl/openssl.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99205@lists.php.net to get a copy of this message | ||
Commit: 58df6a3b61f5cb914d899fbb44eecadad8098700
Author: Jakub Zelenka <bukka@php.net> Mon, 28 Aug 2017 18:48:25 +0100
Parents: 752fc86f2b658988b5bd8ac4605de7371a5fbd0a
Branches: PHP-7.2
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=58df6a3b61f5cb914d899fbb44eecadad8098700
Log:
Do not explicitly initialize and clean up OpenSSL for OpenSSL 1.1
Changed paths:
M ext/openssl/openssl.c
Diff:
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 19cc0ac..72c6e1b 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1415,6 +1415,7 @@ PHP_MINIT_FUNCTION(openssl)
le_x509 = zend_register_list_destructors_ex(php_openssl_x509_free, NULL, "OpenSSL
X.509", module_number);
le_csr = zend_register_list_destructors_ex(php_openssl_csr_free, NULL, "OpenSSL X.509
CSR", module_number);
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
SSL_library_init();
OpenSSL_add_all_ciphers();
OpenSSL_add_all_digests();
@@ -1427,6 +1428,7 @@ PHP_MINIT_FUNCTION(openssl)
#endif
SSL_load_error_strings();
+#endif
/* register a resource id number with OpenSSL so that we can map SSL -> stream structures in
* OpenSSL callbacks */
@@ -1591,12 +1593,14 @@ PHP_MINFO_FUNCTION(openssl)
*/
PHP_MSHUTDOWN_FUNCTION(openssl)
{
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER)
EVP_cleanup();
/* prevent accessing locking callback from unloaded extension */
CRYPTO_set_locking_callback(NULL);
/* free allocated error strings */
ERR_free_strings();
+#endif
php_unregister_url_stream_wrapper("https");
php_unregister_url_stream_wrapper("ftps");