Send decode error alert when EOED parsing fail

Signed-off-by: Jerry Yu <jerry.h.yu@arm.com>
This commit is contained in:
Jerry Yu 2023-12-04 10:00:37 +08:00
parent 3be850782c
commit fbf039932a

View file

@ -2910,7 +2910,12 @@ static int ssl_tls13_parse_end_of_early_data(mbedtls_ssl_context *ssl,
* struct {} EndOfEarlyData;
*/
((void) ssl);
return buf == end ? 0 : MBEDTLS_ERR_SSL_UNEXPECTED_MESSAGE;
if (buf != end) {
MBEDTLS_SSL_PEND_FATAL_ALERT(MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,
MBEDTLS_ERR_SSL_DECODE_ERROR);
return MBEDTLS_ERR_SSL_DECODE_ERROR;
}
return 0;
}
MBEDTLS_CHECK_RETURN_CRITICAL