From 0bfd45f309d48a3d89135605a8172607845112f1 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 --- 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 98e0f09..35a1292 100644 --- a/php.spec +++ b/php.spec @@ -67,7 +67,7 @@ Summary: PHP scripting language for creating dynamic web sites Name: php Version: %{upver}%{?rcver:~%{rcver}} -Release: 1%{?dist} +Release: 2%{?dist} # All files licensed under PHP version 3.01, except # Zend is licensed under Zend # TSRM is licensed under BSD @@ -111,6 +111,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+) @@ -718,6 +720,7 @@ support for JavaScript Object Notation (JSON) to PHP. %endif %patch46 -p1 -b .fixheader %patch47 -p1 -b .phpinfo +%patch48 -p1 -b .loadconf # upstream patches @@ -1505,6 +1508,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