rasmus                                   Sun, 24 Apr 2011 23:27:48 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=310458

Log:
SSLV2 patch cleanup

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
    U   php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c
    U   php/php-src/trunk/ext/openssl/openssl.c
    U   php/php-src/trunk/ext/openssl/xp_ssl.c

Modified: php/php-src/branches/PHP_5_3/ext/openssl/openssl.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2011-04-24 22:08:11 UTC 
(rev 310457)
+++ php/php-src/branches/PHP_5_3/ext/openssl/openssl.c  2011-04-24 23:27:48 UTC 
(rev 310458)
@@ -1074,7 +1074,9 @@

        php_stream_xport_register("ssl", php_openssl_ssl_socket_factory 
TSRMLS_CC);
        php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory 
TSRMLS_CC);
+#ifndef OPENSSL_NO_SSL2
        php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory 
TSRMLS_CC);
+#endif
        php_stream_xport_register("tls", php_openssl_ssl_socket_factory 
TSRMLS_CC);

        /* override the default tcp socket provider */
@@ -1109,7 +1111,9 @@
        php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);

        php_stream_xport_unregister("ssl" TSRMLS_CC);
+#ifndef OPENSSL_NO_SSL2
        php_stream_xport_unregister("sslv2" TSRMLS_CC);
+#endif
        php_stream_xport_unregister("sslv3" TSRMLS_CC);
        php_stream_xport_unregister("tls" TSRMLS_CC);


Modified: php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-04-24 22:08:11 UTC 
(rev 310457)
+++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-04-24 23:27:48 UTC 
(rev 310458)
@@ -330,8 +330,8 @@
                        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;
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 
support is not compiled into the openSSL library PHP is linked against");
+                       return -1;
 #else
                        sslsock->is_client = 1;
                        method = SSLv2_client_method();
@@ -355,8 +355,8 @@
                        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;
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 
support is not compiled into the openSSL library PHP is linked against");
+                       return -1;
 #else
                        sslsock->is_client = 0;
                        method = SSLv2_server_method();
@@ -922,8 +922,13 @@
                sslsock->enable_on_connect = 1;
                sslsock->method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
        } else if (strncmp(proto, "sslv2", protolen) == 0) {
+#ifdef OPENSSL_NO_SSL2
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 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_SSLv2_CLIENT;
+#endif
        } else if (strncmp(proto, "sslv3", protolen) == 0) {
                sslsock->enable_on_connect = 1;
                sslsock->method = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;

Modified: php/php-src/trunk/ext/openssl/openssl.c
===================================================================
--- php/php-src/trunk/ext/openssl/openssl.c     2011-04-24 22:08:11 UTC (rev 
310457)
+++ php/php-src/trunk/ext/openssl/openssl.c     2011-04-24 23:27:48 UTC (rev 
310458)
@@ -1111,7 +1111,9 @@

        php_stream_xport_register("ssl", php_openssl_ssl_socket_factory 
TSRMLS_CC);
        php_stream_xport_register("sslv3", php_openssl_ssl_socket_factory 
TSRMLS_CC);
+#ifndef OPENSSL_NO_SSL2
        php_stream_xport_register("sslv2", php_openssl_ssl_socket_factory 
TSRMLS_CC);
+#endif
        php_stream_xport_register("tls", php_openssl_ssl_socket_factory 
TSRMLS_CC);

        /* override the default tcp socket provider */
@@ -1146,7 +1148,9 @@
        php_unregister_url_stream_wrapper("ftps" TSRMLS_CC);

        php_stream_xport_unregister("ssl" TSRMLS_CC);
+#ifndef OPENSSL_NO_SSL2
        php_stream_xport_unregister("sslv2" TSRMLS_CC);
+#endif
        php_stream_xport_unregister("sslv3" TSRMLS_CC);
        php_stream_xport_unregister("tls" TSRMLS_CC);


Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===================================================================
--- php/php-src/trunk/ext/openssl/xp_ssl.c      2011-04-24 22:08:11 UTC (rev 
310457)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c      2011-04-24 23:27:48 UTC (rev 
310458)
@@ -330,8 +330,8 @@
                        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;
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 
support is not compiled into the openSSL library PHP is linked against");
+                       return -1;
 #else
                        sslsock->is_client = 1;
                        method = SSLv2_client_method();
@@ -355,8 +355,8 @@
                        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;
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 
support is not compiled into the openSSL library PHP is linked against");
+                       return -1;
 #else
                        sslsock->is_client = 0;
                        method = SSLv2_server_method();
@@ -922,8 +922,13 @@
                sslsock->enable_on_connect = 1;
                sslsock->method = STREAM_CRYPTO_METHOD_SSLv23_CLIENT;
        } else if (strncmp(proto, "sslv2", protolen) == 0) {
+#ifdef OPENSSL_NO_SSL2
+               php_error_docref(NULL TSRMLS_CC, E_WARNING, "SSLv2 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_SSLv2_CLIENT;
+#endif
        } else if (strncmp(proto, "sslv3", protolen) == 0) {
                sslsock->enable_on_connect = 1;
                sslsock->method = STREAM_CRYPTO_METHOD_SSLv3_CLIENT;

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to