Fix ssl_cli resumption guards

This commit is contained in:
Jarno Lamsa 2019-06-19 16:20:30 +03:00 committed by Manuel Pégourié-Gonnard
parent 4f74f6d301
commit dbf6073fa3

View File

@ -1805,9 +1805,6 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
*/
#if defined(MBEDTLS_SSL_SESSION_RESUMPTION)
if( ssl->handshake->resume == 0 || n == 0 ||
#else
if( n == 0 ||
#endif /* MBEDTLS_SSL_SESSION_RESUMPTION */
#if defined(MBEDTLS_SSL_RENEGOTIATION)
ssl->renego_status != MBEDTLS_SSL_INITIAL_HANDSHAKE ||
#endif
@ -1815,6 +1812,7 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
ssl->session_negotiate->compression != comp ||
ssl->session_negotiate->id_len != n ||
memcmp( ssl->session_negotiate->id, buf + 35, n ) != 0 )
#endif /* MBEDTLS_SSL_SESSION_RESUMPTION */
{
ssl->state++;
#if defined(MBEDTLS_SSL_SESSION_RESUMPTION)
@ -1828,6 +1826,7 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
ssl->session_negotiate->id_len = n;
memcpy( ssl->session_negotiate->id, buf + 35, n );
}
#if defined(MBEDTLS_SSL_SESSION_RESUMPTION)
else
{
ssl->state = MBEDTLS_SSL_SERVER_CHANGE_CIPHER_SPEC;
@ -1840,6 +1839,7 @@ static int ssl_parse_server_hello( mbedtls_ssl_context *ssl )
return( ret );
}
}
#endif /* MBEDTLS_SSL_SESSION_RESUMPTION */
#if defined(MBEDTLS_SSL_SESSION_RESUMPTION)
MBEDTLS_SSL_DEBUG_MSG( 3, ( "%s session has been resumed",