[PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/ext/openssl/xp_ssl.c PHP_5_4/ext/openssl/xp_ssl.c

2011-11-12 Thread Mateusz Kocielski
shm  Sat, 12 Nov 2011 10:36:55 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319095

Log:
- Fixed NULL pointer dereference in stream_socket_enable_crypto, case when
  ssl_handle of session_stream is not initialized.

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

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-11-12 08:57:13 UTC 
(rev 319094)
+++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-11-12 10:36:55 UTC 
(rev 319095)
@@ -406,6 +406,8 @@
if (cparam-inputs.session) {
if (cparam-inputs.session-ops != php_openssl_socket_ops) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
session stream must be an SSL enabled stream);
+   } else if 
(((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle 
== NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
SSL session stream is not initialized);
} else {
SSL_copy_session_id(sslsock-ssl_handle, 
((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle);
}

Modified: php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c
===
--- php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c   2011-11-12 08:57:13 UTC 
(rev 319094)
+++ php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c   2011-11-12 10:36:55 UTC 
(rev 319095)
@@ -406,6 +406,8 @@
if (cparam-inputs.session) {
if (cparam-inputs.session-ops != php_openssl_socket_ops) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
session stream must be an SSL enabled stream);
+   } else if 
(((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle 
== NULL) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING, supplied 
SSL session stream is not initialized);
} else {
SSL_copy_session_id(sslsock-ssl_handle, 
((php_openssl_netstream_data_t*)cparam-inputs.session-abstract)-ssl_handle);
}

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

Re: [PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/ext/openssl/xp_ssl.c PHP_5_4/ext/openssl/xp_ssl.c

2011-11-12 Thread Johannes Schlüter
On Sat, 2011-11-12 at 10:36 +, Mateusz Kocielski wrote:
 
 Log:
 - Fixed NULL pointer dereference in stream_socket_enable_crypto, case
 when
   ssl_handle of session_stream is not initialized.
 
 Changed paths:
 U   php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c
 U   php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c
 
 

I see this had been applied to trunk before. Any bug ID or other entry
for NEWS?

johannes



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



Re: [PHP-CVS] svn: /php/php-src/branches/ PHP_5_3/ext/openssl/xp_ssl.c PHP_5_4/ext/openssl/xp_ssl.c

2011-11-12 Thread Pierre Joye
 #60279

2011/11/12 Johannes Schlüter johan...@schlueters.de:
 On Sat, 2011-11-12 at 10:36 +, Mateusz Kocielski wrote:

 Log:
 - Fixed NULL pointer dereference in stream_socket_enable_crypto, case
 when
   ssl_handle of session_stream is not initialized.

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



 I see this had been applied to trunk before. Any bug ID or other entry
 for NEWS?

 johannes



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





-- 
Pierre

@pierrejoye | http://blog.thepimp.net | http://www.libgd.org

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



[PHP-CVS] svn: /php/php-src/branches/PHP_5_3/ext/openssl/ xp_ssl.c

2011-08-22 Thread Johannes Schlüter
johannes Mon, 22 Aug 2011 21:32:04 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=315310

Log:
- Revert r313616 (When we have a blocking SSL socket, respect the timeout
  option, scottmac)

# This caused bug #55283, we should investigate a proper solution without
# breaking anything.

Bug: https://bugs.php.net/55283 (Verified) SSL options set by mysqli_ssl_set 
ignored for MySQLi persistent connections
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c

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-08-22 20:28:33 UTC 
(rev 315309)
+++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-08-22 21:32:04 UTC 
(rev 315310)
@@ -204,36 +204,6 @@
return didwrite;
 }

-static void php_openssl_stream_wait_for_data(php_stream *stream, 
php_netstream_data_t *sock TSRMLS_DC)
-{
-   int retval;
-   struct timeval *ptimeout;
-
-   if (sock-socket == -1) {
-   return;
-   }
-
-   sock-timeout_event = 0;
-
-   if (sock-timeout.tv_sec == -1)
-   ptimeout = NULL;
-   else
-   ptimeout = sock-timeout;
-
-   while(1) {
-   retval = php_pollfd_for(sock-socket, PHP_POLLREADABLE, 
ptimeout);
-
-   if (retval == 0)
-   sock-timeout_event = 1;
-
-   if (retval = 0)
-   break;
-
-   if (php_socket_errno() != EINTR)
-   break;
-   }
-}
-
 static size_t php_openssl_sockop_read(php_stream *stream, char *buf, size_t 
count TSRMLS_DC)
 {
php_openssl_netstream_data_t *sslsock = 
(php_openssl_netstream_data_t*)stream-abstract;
@@ -243,13 +213,6 @@
int retry = 1;

do {
-   if (sslsock-s.is_blocked) {
-   php_openssl_stream_wait_for_data(stream, 
(sslsock-s) TSRMLS_CC);
-   if (sslsock-s.timeout_event) {
-   break;
-   }
-   /* there is no guarantee that there is 
application data available but something is there */
-   }
nr_bytes = SSL_read(sslsock-ssl_handle, buf, count);

if (nr_bytes = 0) {

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/xp_ssl.c branches/PHP_5_4/ext/openssl/xp_ssl.c trunk/ext/openssl/xp_ssl.c

2011-06-10 Thread Felipe Pena
felipe   Fri, 10 Jun 2011 22:48:36 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=312031

Log:
- Fixed bug #55028 (// is abad comment)

Bug: http://bugs.php.net/55028 (Open) // is  abad comment
  
Changed paths:
U   php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c
U   php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c
U   php/php-src/trunk/ext/openssl/xp_ssl.c

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-06-10 22:13:08 UTC 
(rev 312030)
+++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-06-10 22:48:36 UTC 
(rev 312031)
@@ -145,7 +145,7 @@

default:
do {
-   // NULL is automatically added
+   /* NULL is automatically added 
*/
ERR_error_string_n(ecode, 
esbuf, sizeof(esbuf));
if (ebuf.c) {

smart_str_appendc(ebuf, '\n');

Modified: php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c
===
--- php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c   2011-06-10 22:13:08 UTC 
(rev 312030)
+++ php/php-src/branches/PHP_5_4/ext/openssl/xp_ssl.c   2011-06-10 22:48:36 UTC 
(rev 312031)
@@ -145,7 +145,7 @@

default:
do {
-   // NULL is automatically added
+   /* NULL is automatically added 
*/
ERR_error_string_n(ecode, 
esbuf, sizeof(esbuf));
if (ebuf.c) {

smart_str_appendc(ebuf, '\n');

Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===
--- php/php-src/trunk/ext/openssl/xp_ssl.c  2011-06-10 22:13:08 UTC (rev 
312030)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c  2011-06-10 22:48:36 UTC (rev 
312031)
@@ -145,7 +145,7 @@

default:
do {
-   // NULL is automatically added
+   /* NULL is automatically added 
*/
ERR_error_string_n(ecode, 
esbuf, sizeof(esbuf));
if (ebuf.c) {

smart_str_appendc(ebuf, '\n');

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/ext/openssl/xp_ssl.c trunk/ext/openssl/xp_ssl.c

2011-04-24 Thread Rasmus Lerdorf
rasmus   Sun, 24 Apr 2011 20:47:22 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=310456

Log:
Support for openssl without SSLv2 supprot compiled in. Distros are starting to
remove support now and this wasn't compiling anymore on my Debian dev box.

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

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 13:25:01 UTC 
(rev 310455)
+++ php/php-src/branches/PHP_5_3/ext/openssl/xp_ssl.c   2011-04-24 20:47:22 UTC 
(rev 310456)
@@ -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();

Modified: php/php-src/trunk/ext/openssl/xp_ssl.c
===
--- php/php-src/trunk/ext/openssl/xp_ssl.c  2011-04-24 13:25:01 UTC (rev 
310455)
+++ php/php-src/trunk/ext/openssl/xp_ssl.c  2011-04-24 20:47:22 UTC (rev 
310456)
@@ -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 CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php