summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnatol Belski <ab@php.net>2014-08-25 20:23:14 +0200
committerAnatol Belski <ab@php.net>2014-08-25 20:23:14 +0200
commit54102822583912de26bb6c7cc2d0c609952a4775 (patch)
tree5f2854f26103e087e5258438811c222416bdf623
parent4d997f63d98c663b2d9acccd3655572652f61c7d (diff)
parent3dd5366b15ca8ee74cc119c376bde917e57ac286 (diff)
downloadphp-git-54102822583912de26bb6c7cc2d0c609952a4775.tar.gz
Merge branch 'master' of git.php.net:php-src
# By Daniel Lowrey # Via Daniel Lowrey * 'master' of git.php.net:php-src: Update NEWS Bug #67850: Build when OpenSSL compiled without SSLv3 support
-rw-r--r--ext/openssl/xp_ssl.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index a2406fb572..b0f6d4deca 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -891,7 +891,13 @@ static const SSL_METHOD *php_select_crypto_method(zend_long method_value, int is
return NULL;
#endif
} else if (method_value == STREAM_CRYPTO_METHOD_SSLv3) {
+#ifndef OPENSSL_NO_SSL3
return is_client ? SSLv3_client_method() : SSLv3_server_method();
+#else
+ php_error_docref(NULL TSRMLS_CC, E_WARNING,
+ "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
+ return NULL;
+#endif
} else if (method_value == STREAM_CRYPTO_METHOD_TLSv1_0) {
return is_client ? TLSv1_client_method() : TLSv1_server_method();
} else if (method_value == STREAM_CRYPTO_METHOD_TLSv1_1) {
@@ -2262,8 +2268,13 @@ php_stream *php_openssl_ssl_socket_factory(const char *proto, size_t protolen,
sslsock->method = STREAM_CRYPTO_METHOD_SSLv2_CLIENT;
#endif
} else if (strncmp(proto, "sslv3", protolen) == 0) {
+#ifdef OPENSSL_NO_SSL3
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv3 support is not compiled into the OpenSSL library PHP is linked against");
+ return NULL;
+#else
sslsock->enable_on_connect = 1;
sslsock->method = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;
+#endif
} else if (strncmp(proto, "tls", protolen) == 0) {
sslsock->enable_on_connect = 1;
sslsock->method = get_crypto_method(context, STREAM_CRYPTO_METHOD_TLS_CLIENT);