From 6cb422654de11eb13f50b36d7d59e65fec029229 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Tue, 21 Feb 2017 16:40:16 +0000 Subject: [PATCH] Change the cipher state when sending early data Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2737) --- ssl/statem/statem_clnt.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ssl/statem/statem_clnt.c b/ssl/statem/statem_clnt.c index 6507fc7d59..390e475fa4 100644 --- a/ssl/statem/statem_clnt.c +++ b/ssl/statem/statem_clnt.c @@ -704,6 +704,18 @@ WORK_STATE ossl_statem_client_post_work(SSL *s, WORK_STATE wst) /* Treat the next message as the first packet */ s->first_packet = 1; } + + if (s->early_data_state == SSL_EARLY_DATA_CONNECTING + && s->max_early_data > 0) { + /* + * We haven't selected TLSv1.3 yet so we don't call the change + * cipher state function associated with the SSL_METHOD. Instead + * we call tls13_change_cipher_state() directly. + */ + if (!tls13_change_cipher_state(s, + SSL3_CC_EARLY | SSL3_CHANGE_CIPHER_CLIENT_WRITE)) + return WORK_ERROR; + } break; case TLS_ST_CW_KEY_EXCH: -- 2.25.1