Remove field to store level of pending alert

Pending alerts is so far only used for fatal alerts.
This commit is contained in:
Hanno Becker 2019-07-24 13:34:14 +01:00
parent de62da9d3c
commit 3caf7189f9
3 changed files with 1 additions and 6 deletions

View File

@ -1235,7 +1235,6 @@ struct mbedtls_ssl_context
{
const mbedtls_ssl_config *conf; /*!< configuration information */
unsigned char pend_alert_level;
unsigned char pend_alert_msg;
/*

View File

@ -1734,8 +1734,6 @@ MBEDTLS_ALWAYS_INLINE static inline int mbedtls_ssl_pend_fatal_alert(
mbedtls_ssl_context *ssl,
unsigned char message )
{
/* ssl->pend_alert_level is fatal by default,
* so we don't need set it here. */
ssl->pend_alert_msg = message;
return( 0 );
}

View File

@ -7975,7 +7975,6 @@ int mbedtls_ssl_setup( mbedtls_ssl_context *ssl,
goto error;
ssl->pend_alert_msg = MBEDTLS_SSL_ALERT_MSG_NONE;
ssl->pend_alert_level = MBEDTLS_SSL_ALERT_LEVEL_FATAL;
return( 0 );
@ -9832,10 +9831,9 @@ int mbedtls_ssl_handshake_step( mbedtls_ssl_context *ssl )
if( ssl->pend_alert_msg != MBEDTLS_SSL_ALERT_MSG_NONE )
{
mbedtls_ssl_send_alert_message( ssl,
ssl->pend_alert_level,
MBEDTLS_SSL_ALERT_LEVEL_FATAL,
ssl->pend_alert_msg );
ssl->pend_alert_msg = MBEDTLS_SSL_ALERT_MSG_NONE;
ssl->pend_alert_level = MBEDTLS_SSL_ALERT_LEVEL_FATAL;
}
return( ret );
}