From 7916b2196f03986125955d7dab84eac913854c06 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 6 Sep 2017 13:14:52 +0200 Subject: [PATCH] Automatically load OpenSSL configuration file, from PHP 7.2 (cherry picked from commit 0bfd45f309d48a3d89135605a8172607845112f1) --- php-7.1.9-openssl-load-config.patch | 52 +++++++++++++++++++++++++++++ php.spec | 8 ++++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 php-7.1.9-openssl-load-config.patch diff --git a/php-7.1.9-openssl-load-config.patch b/php-7.1.9-openssl-load-config.patch new file mode 100644 index 0000000..c998667 --- /dev/null +++ b/php-7.1.9-openssl-load-config.patch @@ -0,0 +1,52 @@ +Backported from PHP 7.2 + + +From 58df6a3b61f5cb914d899fbb44eecadad8098700 Mon Sep 17 00:00:00 2001 +From: Jakub Zelenka +Date: Mon, 28 Aug 2017 18:48:25 +0100 +Subject: [PATCH] Do not explicitly initialize and clean up OpenSSL for OpenSSL + 1.1 + +From 1f843a8fb50de77a3f53a6b892a46d9e0afdfdd7 Mon Sep 17 00:00:00 2001 +From: Jakub Zelenka +Date: Mon, 28 Aug 2017 19:25:18 +0100 +Subject: [PATCH] Automatically load OpenSSL configuration file + +diff -up ./ext/openssl/openssl.c.loadconf ./ext/openssl/openssl.c +--- ./ext/openssl/openssl.c.loadconf 2017-08-30 18:13:18.000000000 +0200 ++++ ./ext/openssl/openssl.c 2017-09-06 13:11:47.212803443 +0200 +@@ -1409,6 +1409,8 @@ PHP_MINIT_FUNCTION(openssl) + le_x509 = zend_register_list_destructors_ex(php_x509_free, NULL, "OpenSSL X.509", module_number); + le_csr = zend_register_list_destructors_ex(php_csr_free, NULL, "OpenSSL X.509 CSR", module_number); + ++#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined (LIBRESSL_VERSION_NUMBER) ++ OPENSSL_config(NULL); + SSL_library_init(); + OpenSSL_add_all_ciphers(); + OpenSSL_add_all_digests(); +@@ -1421,6 +1423,9 @@ PHP_MINIT_FUNCTION(openssl) + #endif + + SSL_load_error_strings(); ++#else ++ OPENSSL_init_ssl(OPENSSL_INIT_LOAD_CONFIG, NULL); ++#endif + + /* register a resource id number with OpenSSL so that we can map SSL -> stream structures in + * OpenSSL callbacks */ +@@ -1585,12 +1590,15 @@ 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(); ++ CONF_modules_free(); ++#endif + + php_unregister_url_stream_wrapper("https"); + php_unregister_url_stream_wrapper("ftps"); diff --git a/php.spec b/php.spec index a38b7a1..ea01d3d 100644 --- a/php.spec +++ b/php.spec @@ -62,7 +62,7 @@ %endif #global rcver RC1 -%global rpmrel 1 +%global rpmrel 2 Summary: PHP scripting language for creating dynamic web sites Name: php @@ -110,6 +110,8 @@ Patch45: php-5.6.3-ldap_r.patch Patch46: php-7.0.0-fixheader.patch # drop "Configure command" from phpinfo output Patch47: php-5.6.3-phpinfo.patch +# Automatically load OpenSSL configuration file +Patch48: php-7.1.9-openssl-load-config.patch # Upstream fixes (100+) @@ -714,6 +716,7 @@ httpd -V | grep -q 'threaded:.*yes' && exit 1 %endif %patch46 -p1 -b .fixheader %patch47 -p1 -b .phpinfo +%patch48 -p1 -b .loadconf # upstream patches @@ -1501,6 +1504,9 @@ rm -f README.{Zeus,QNX,CVS-RULES} %changelog +* Wed Sep 6 2017 Remi Collet - 7.1.9-2 +- Automatically load OpenSSL configuration file, from PHP 7.2 + * Wed Aug 30 2017 Remi Collet - 7.1.9-1 - Update to 7.1.9 - http://www.php.net/releases/7_1_9.php