php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #54507
Patch openssl-without-sslv2 revision 2011-04-11 15:22 UTC by crrodriguez at opensuse dot org

Patch openssl-without-sslv2 for OpenSSL related Bug #54507

Patch version 2011-04-11 15:22 UTC

Return to Bug #54507 | Download this patch
Patch Revisions:

Developer: crrodriguez@opensuse.org

Index: ext/openssl/xp_ssl.c
===================================================================
--- ext/openssl/xp_ssl.c	(revisión: 310141)
+++ ext/openssl/xp_ssl.c	(copia de trabajo)
@@ -329,9 +329,14 @@
 			method = SSLv23_client_method();
 			break;
 		case STREAM_CRYPTO_METHOD_SSLv2_CLIENT:
+#ifdef OPENSSL_NO_SSL2
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled in openSSL");
+            return -1;
+#else
 			sslsock->is_client = 1;
 			method = SSLv2_client_method();
 			break;
+#endif
 		case STREAM_CRYPTO_METHOD_SSLv3_CLIENT:
 			sslsock->is_client = 1;
 			method = SSLv3_client_method();
@@ -349,9 +354,14 @@
 			method = SSLv3_server_method();
 			break;
 		case STREAM_CRYPTO_METHOD_SSLv2_SERVER:
+#ifdef OPENSSL_NO_SSL2
+            php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 support is not compiled in openSSL");
+            return -1;
+#else
 			sslsock->is_client = 0;
 			method = SSLv2_server_method();
 			break;
+#endif
 		case STREAM_CRYPTO_METHOD_TLS_SERVER:
 			sslsock->is_client = 0;
 			method = TLSv1_server_method();
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 09:01:29 2024 UTC