Only enable receiving early data if client asked for it

Fixes a handshake failure when a 0-RTT capable server receives a
non-0-RTT resumption.
This commit is contained in:
Benjamin Saunders 2019-02-03 13:34:52 -08:00 committed by ctz
parent 5c360613e6
commit ec3604ca01
1 changed files with 1 additions and 0 deletions

View File

@ -237,6 +237,7 @@ impl ExpectClientHello {
if let Some(resume) = resumedata {
if sess.config.max_early_data_size > 0
&& hello.early_data_extension_offered()
&& resume.version == sess.common.negotiated_version.unwrap()
&& resume.cipher_suite == sess.common.get_suite_assert().suite
&& resume.alpn.as_ref().map(|x| &x.0) == sess.alpn_protocol.as_ref()