tls13: Improve sanity check in get_early_data_status

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron 2024-02-22 12:05:42 +01:00
parent 8f1de7e029
commit f19989da31

View file

@ -2321,7 +2321,7 @@ cleanup:
int mbedtls_ssl_get_early_data_status(mbedtls_ssl_context *ssl)
{
if ((ssl->conf->endpoint == MBEDTLS_SSL_IS_SERVER) ||
if ((ssl->conf->endpoint != MBEDTLS_SSL_IS_CLIENT) ||
(!mbedtls_ssl_is_handshake_over(ssl))) {
return MBEDTLS_ERR_SSL_BAD_INPUT_DATA;
}