Add hard assertion to ssl_read_record

This commit adds a hard assertion to mbedtls_ssl_read_record
triggering if both ssl->in_hslen and ssl->in_offt are not 0. This
should never happen, and if it does, there's no sensible way of
telling whether the previous message was a handshake or an application
data message.
This commit is contained in:
Hanno Becker 2017-06-08 15:58:02 +01:00
parent d37839e3fa
commit 1bf86b7e32

View file

@ -2180,6 +2180,12 @@ int ssl_read_record( ssl_context *ssl )
if( ssl->in_hslen != 0 )
{
if( ssl->in_offt != NULL )
{
SSL_DEBUG_MSG( 1, ( "should never happen" ) );
return( POLARSSL_ERR_SSL_INTERNAL_ERROR );
}
/*
* Get next Handshake message in the current record
*/