From 9f94e0b51c5e5371c26890b16d9f307f66260bb5 Mon Sep 17 00:00:00 2001 From: Daniel Lowrey Date: Thu, 20 Feb 2014 17:20:40 -0700 Subject: [PATCH] Improve OpenSSL compile flag compatibility, minor updates --- ext/openssl/tests/bug66501.phpt | 2 +- ext/openssl/tests/tlsv1.0_wrapper.phpt | 1 - ext/openssl/xp_ssl.c | 32 +++++++------------------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/ext/openssl/tests/bug66501.phpt b/ext/openssl/tests/bug66501.phpt index cd0da1f289..7ad5e21749 100644 --- a/ext/openssl/tests/bug66501.phpt +++ b/ext/openssl/tests/bug66501.phpt @@ -3,7 +3,7 @@ Bug #66501: EC private key support in openssl_sign --SKIPIF-- = 0x10001001L + if (!(method_flags & STREAM_CRYPTO_METHOD_TLSv1_1)) { ssl_ctx_options |= SSL_OP_NO_TLSv1_1; -#endif - } else { -#if OPENSSL_VERSION_NUMBER < 0x10001001L - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "TLSv1.1 support is not compiled into the OpenSSL library PHP is linked against"); - return -1; -#endif } if (!(method_flags & STREAM_CRYPTO_METHOD_TLSv1_2)) { -#if OPENSSL_VERSION_NUMBER >= 0x10001001L ssl_ctx_options |= SSL_OP_NO_TLSv1_2; -#endif - } else { -#if OPENSSL_VERSION_NUMBER < 0x10001001L - php_error_docref(NULL TSRMLS_CC, E_WARNING, - "TLSv1.2 support is not compiled into the OpenSSL library PHP is linked against"); - return -1; -#endif } +#endif return ssl_ctx_options; } @@ -388,6 +375,7 @@ static inline int php_openssl_setup_crypto(php_stream *stream, const SSL_METHOD *method; long ssl_ctx_options; long method_flags; + zval **val; if (sslsock->ssl_handle) { if (sslsock->s.is_blocked) { @@ -431,8 +419,6 @@ static inline int php_openssl_setup_crypto(php_stream *stream, #if OPENSSL_VERSION_NUMBER >= 0x0090806fL { - zval **val; - if (stream->context && SUCCESS == php_stream_context_get_option( stream->context, "ssl", "no_ticket", &val) && zend_is_true(*val) @@ -444,8 +430,6 @@ static inline int php_openssl_setup_crypto(php_stream *stream, #if OPENSSL_VERSION_NUMBER >= 0x10000000L { - zval **val; - if (stream->context && (FAILURE == php_stream_context_get_option( stream->context, "ssl", "disable_compression", &val) || zend_is_true(*val)) -- 2.40.0