[openssl-dev] [openssl.org #2759] SSL_read / SSL_ERROR_WANT_READ / ENOTCONN infinite loop

2016-06-12 Thread Rich Salz via RT
applied in master, commit a3ef2c16792ccbf65ef9861e0df6e7c277bcf770 thank you!

-- 
Ticket here: http://rt.openssl.org/Ticket/Display.html?id=2759
Please log in as guest with password guest if prompted

-- 
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


[openssl.org #2759] SSL_read / SSL_ERROR_WANT_READ / ENOTCONN infinite loop

2012-03-14 Thread Steven Parkes via RT
Type: bug report
OS: iOS (but may affect other platforms, mobile in particular)
OpenSSL versions: confirmed in 1.0.0.h and 1.0.1 Beta 3

Bug:

int BIO_sock_non_fatal_error(int err) in crypto/bio/bss_sock.c returns 1 for 
ENOTCONN which causes SSL_read to return SSL_ERROR_WANT_READ.  In at least some 
cases, ENOTCONN is fatal. In those cases, the SSL_read caller (in my case, 
libcurl), ends up calling SSL_read infinitely.

This occurs repeatably on iOS and possibly other mobile platforms which tend to 
tear down socket connections if an app becomes inactive.

My workaround has been simply not to include ENOTCONN in the non-fatal codes. 
This doesn't have any negative side effects in my testing but I'm not sure if 
it might in general. I don't know enough whether ENOTCONN might be validly 
returned before TCP handshaking has finished and if, in that case, if the flow 
of SSL connection creation might go through this function. If that were the 
case, it seems like it's going to take more significant refactoring to be able 
to tell from connection context whether ENOTCONN is fatal or not.
__
OpenSSL Project http://www.openssl.org
Development Mailing List   openssl-dev@openssl.org
Automated List Manager   majord...@openssl.org