From 10109364bf0f07c393bd4283470f1bf57f31cecb Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Thu, 23 Feb 2017 12:36:35 +0000 Subject: [PATCH] Disallow handshake messages in the middle of early_data Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2737) --- ssl/statem/statem_srvr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ssl/statem/statem_srvr.c b/ssl/statem/statem_srvr.c index 0f68ddf504..e6a84dfa7b 100644 --- a/ssl/statem/statem_srvr.c +++ b/ssl/statem/statem_srvr.c @@ -129,6 +129,12 @@ static int ossl_statem_server13_read_transition(SSL *s, int mt) break; case TLS_ST_OK: + /* + * Its never ok to start processing handshake messages in the middle of + * early data (i.e. before we've received the end of early data alert) + */ + if (s->early_data_state == SSL_EARLY_DATA_READING) + break; if (mt == SSL3_MT_KEY_UPDATE) { st->hand_state = TLS_ST_SR_KEY_UPDATE; return 1; -- 2.25.1