From: Matt Caswell Date: Fri, 24 Feb 2017 10:29:20 +0000 (+0000) Subject: Add extra validation parsing the server-to-client early_data extension X-Git-Tag: OpenSSL_1_1_1-pre1~2152 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=538bea6c8184670a8d1608ef288a4e1813dcefa6 Add extra validation parsing the server-to-client early_data extension Check that we actually resumed the session, and that we selected the first identity. Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/2737) --- diff --git a/ssl/statem/extensions_clnt.c b/ssl/statem/extensions_clnt.c index 1dbc355e2b..778d2c87e3 100644 --- a/ssl/statem/extensions_clnt.c +++ b/ssl/statem/extensions_clnt.c @@ -931,10 +931,12 @@ int tls_parse_stoc_early_data(SSL *s, PACKET *pkt, unsigned int context, return 0; } - if (s->ext.early_data != SSL_EARLY_DATA_REJECTED) { + if (s->ext.early_data != SSL_EARLY_DATA_REJECTED + || !s->hit + || s->session->ext.tick_identity != 0) { /* - * If we get here then we didn't send early data, so the server should - * not be accepting it. + * If we get here then we didn't send early data, or we didn't resume + * using the first identity so the server should not be accepting it. */ *al = SSL_AD_ILLEGAL_PARAMETER; return 0;