File php5-openssl.patch of Package php55

Index: ext/openssl/openssl.c
===================================================================
--- ext/openssl/openssl.c.orig
+++ ext/openssl/openssl.c
@@ -47,6 +47,7 @@
 #include <openssl/rand.h>
 #include <openssl/ssl.h>
 #include <openssl/pkcs12.h>
+#include <openssl/engine.h>
 
 /* Common */
 #include <time.h>
@@ -1048,10 +1049,16 @@ 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);
 
+    OPENSSL_config(NULL);
 	SSL_library_init();
 	OpenSSL_add_all_ciphers();
 	OpenSSL_add_all_digests();
 	OpenSSL_add_all_algorithms();
+/* Load all bundled ENGINEs into memory and make them visible */
+    ENGINE_load_builtin_engines();
+ /* Register all of them for every algorithm they collectively implement */
+    ENGINE_register_all_complete();
+
 
 	SSL_load_error_strings();
 
Index: ext/openssl/xp_ssl.c
===================================================================
--- ext/openssl/xp_ssl.c.orig
+++ ext/openssl/xp_ssl.c
@@ -378,6 +378,10 @@ static inline int php_openssl_setup_cryp
 		return -1;
 	}
 
+#ifdef SSL_MODE_RELEASE_BUFFERS
+    SSL_CTX_set_mode(sslsock->ctx, SSL_MODE_RELEASE_BUFFERS);
+#endif
+
 #if OPENSSL_VERSION_NUMBER >= 0x0090605fL
 	ssl_ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
 #endif
openSUSE Build Service is sponsored by