From: Matt Caswell Date: Thu, 9 Mar 2017 22:58:05 +0000 (+0000) Subject: Check ClientHello boundary as per draft-19 X-Git-Tag: OpenSSL_1_1_1-pre1~2011 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9e0ac6a2f1237ab72f0f26a032199864c7b71f2e;p=openssl Check ClientHello boundary as per draft-19 Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2895) --- diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 259be22106..608bef2215 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -1534,6 +1534,14 @@ static int tls_early_post_process_client_hello(SSL *s, int *al) goto err; } + /* TLSv1.3 defines that a ClientHello must end on a record boundary */ + if (SSL_IS_TLS13(s) && RECORD_LAYER_processed_read_pending(&s->rlayer)) { + *al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_TLS_EARLY_POST_PROCESS_CLIENT_HELLO, + SSL_R_NOT_ON_RECORD_BOUNDARY); + goto err; + } + if (SSL_IS_DTLS(s)) { /* Empty cookie was already handled above by returning early. */ if (SSL_get_options(s) & SSL_OP_COOKIE_EXCHANGE) {