Commits

Ruslan Osmanov  committed c4b43f9

Fix: undefined symbol with SSL_OP_NO_SSLv2

  • Participants
  • Parent commits 354bcdb

Comments (0)

Files changed (3)

File classes/ssl_context.c

 /* }}} */
 
 /* {{{ get_ssl_method */
-static zend_always_inline SSL_METHOD *get_ssl_method(long in_method)
+static zend_always_inline SSL_METHOD *get_ssl_method(long in_method TSRMLS_DC)
 {
 	SSL_METHOD *method;
 
 	switch (in_method) {
     	case PHP_EVENT_SSLv2_CLIENT_METHOD:
+
+#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
     		method = (SSL_METHOD *) SSLv2_client_method();
 			break;
+#endif
     	case PHP_EVENT_SSLv3_CLIENT_METHOD:
     		method = (SSL_METHOD *) SSLv3_client_method();
 			break;
     		method = (SSL_METHOD *) TLSv1_client_method();
 			break;
     	case PHP_EVENT_SSLv2_SERVER_METHOD:
+#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
     		method = (SSL_METHOD *) SSLv2_server_method();
 			break;
+#endif
     	case PHP_EVENT_SSLv3_SERVER_METHOD:
     		method = (SSL_METHOD *) SSLv3_server_method();
 			break;
 		return;
 	}
 
-	method = get_ssl_method(in_method);
+	method = get_ssl_method(in_method TSRMLS_CC);
 	if (method == NULL) {
 		php_error_docref(NULL TSRMLS_CC, E_WARNING,
 			"Invalid method passed: %ld", in_method);
     <email>osmanov@php.net</email>
     <active>yes</active>
   </lead>
-  <date>2013-02-14</date>
+  <date>2013-02-15</date>
   <!--{{{ Current version -->
   <version>
-    <release>1.2.2</release>
+    <release>1.2.3</release>
     <api>1.2.0</api>
   </version>
   <stability>
   <license uri="http://www.php.net/license">PHP</license>
   <notes><![CDATA[
   Fix: build errors
+  Fix: undefined symbol SSLv2_*_method when SL_OP_NO_SSLv2 defined
   ]]></notes>
   <!--}}}-->
   <!--{{{ Contents -->
   </extsrcrelease>
   <!--{{{ changelog-->
   <changelog>
-    <!--{{{ 1.2.2-alpha -->
+    <!--{{{ 1.2.3-alpha -->
     <release>
       <version>
-        <release>1.2.1</release>
+        <release>1.2.3</release>
         <api>1.2.0</api>
       </version>
       <stability>
       <license uri="http://www.php.net/license">PHP</license>
       <notes><![CDATA[
   Fix: build errors
+  Fix: undefined symbol SSLv2_*_method when SL_OP_NO_SSLv2 defined
   ]]></notes>
     </release>
     <!--}}}-->
 #ifndef PHP_EVENT_H
 #define PHP_EVENT_H
 
-#define PHP_EVENT_VERSION "1.2.2-alpha"
+#define PHP_EVENT_VERSION "1.2.3-alpha"
 
 
 extern zend_module_entry event_module_entry;