Author: remm Date: Thu Feb 15 12:05:55 2018 New Revision: 1824301 URL: http://svn.apache.org/viewvc?rev=1824301&view=rev Log: Overflow during handshake is an invalid situation, so fix the NIO handshake. Also improve the error message with the actual status.
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java tomcat/trunk/webapps/docs/changelog.xml Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java?rev=1824301&r1=1824300&r2=1824301&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNio2Channel.java Thu Feb 15 12:05:55 2018 @@ -320,7 +320,7 @@ public class SecureNio2Channel extends N } return 1; } else { - throw new IOException(sm.getString("channel.nio.ssl.unexpectedStatusDuringUnwrap", handshakeStatus)); + throw new IOException(sm.getString("channel.nio.ssl.unexpectedStatusDuringUnwrap", handshake.getStatus())); } break; } Modified: tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java?rev=1824301&r1=1824300&r2=1824301&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/SecureNioChannel.java Thu Feb 15 12:05:55 2018 @@ -242,10 +242,8 @@ public class SecureNioChannel extends Ni } else if ( handshake.getStatus() == Status.BUFFER_UNDERFLOW ){ //read more data, reregister for OP_READ return SelectionKey.OP_READ; - } else if (handshake.getStatus() == Status.BUFFER_OVERFLOW) { - getBufHandler().configureReadBufferForWrite(); } else { - throw new IOException(sm.getString("channel.nio.ssl.unexpectedStatusDuringWrap", handshakeStatus)); + throw new IOException(sm.getString("channel.nio.ssl.unexpectedStatusDuringWrap", handshake.getStatus())); }//switch break; } Modified: tomcat/trunk/webapps/docs/changelog.xml URL: http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1824301&r1=1824300&r2=1824301&view=diff ============================================================================== --- tomcat/trunk/webapps/docs/changelog.xml (original) +++ tomcat/trunk/webapps/docs/changelog.xml Thu Feb 15 12:05:55 2018 @@ -82,6 +82,10 @@ <fix> Minor OpenSSL engine cleanups. (remm) </fix> + <fix> + NIO SSL handshake should throw an exception on overflow status, like + NIO2 SSL. (remm) + </fix> </changelog> </subsection> <subsection name="Web applications"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org