1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Drop renego state from context if no renego support

This commit is contained in:
Manuel Pégourié-Gonnard
2015-03-10 11:54:02 +00:00
parent d2b35ec3d3
commit 69849f8595
3 changed files with 26 additions and 15 deletions

View File

@ -3205,9 +3205,12 @@ static int ssl_parse_record_header( ssl_context *ssl )
/* Drop unexpected ApplicationData records,
* except at the beginning of renegotiations */
if( ssl->in_msgtype == SSL_MSG_APPLICATION_DATA &&
ssl->state != SSL_HANDSHAKE_OVER &&
! ( ssl->renegotiation == SSL_RENEGOTIATION_IN_PROGRESS &&
ssl->state == SSL_SERVER_HELLO ) )
ssl->state != SSL_HANDSHAKE_OVER
#if defined(POLARSSL_SSL_RENEGOTIATION)
&& ! ( ssl->renegotiation == SSL_RENEGOTIATION_IN_PROGRESS &&
ssl->state == SSL_SERVER_HELLO )
#endif
)
{
SSL_DEBUG_MSG( 1, ( "dropping unexpected ApplicationData" ) );
return( POLARSSL_ERR_SSL_INVALID_RECORD );