diff --git a/library/ssl_tls13_server.c b/library/ssl_tls13_server.c index ff501c8a9..3b560e799 100644 --- a/library/ssl_tls13_server.c +++ b/library/ssl_tls13_server.c @@ -2911,6 +2911,13 @@ static int ssl_tls13_end_of_early_data_coordinate(mbedtls_ssl_context *ssl) if (ssl->in_msgtype == MBEDTLS_SSL_MSG_APPLICATION_DATA) { MBEDTLS_SSL_DEBUG_MSG(3, ("Received early data")); + /* RFC 8446 section 4.6.1 + * + * A server receiving more than max_early_data_size bytes of 0-RTT data + * SHOULD terminate the connection with an "unexpected_message" alert. + * + * TODO: Add received data size check here. + */ return SSL_GOT_EARLY_DATA; } @@ -2956,14 +2963,6 @@ static int ssl_tls13_process_early_application_data(mbedtls_ssl_context *ssl) ssl->in_msg[ssl->in_msglen] = 0; MBEDTLS_SSL_DEBUG_MSG(3, ("\n%s", ssl->in_msg)); - /* RFC 8446 section 4.6.1 - * - * A server receiving more than max_early_data_size bytes of 0-RTT data - * SHOULD terminate the connection with an "unexpected_message" alert. - * - * TODO: Add received data size check here. - */ - return 0; }