From c5665c9ac95998bbfe3957a75ec99dd38c0838f4 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Tue, 15 Nov 2016 18:12:58 +0900 Subject: [PATCH] Remove out-of-date BoGo earlyDataContext parsing bits. This was removed a while ago. As of -18, the early data indication extension is just a boolean. Change-Id: I328b9abfafad326d4c2a3b5fe981af111f8401ad Reviewed-on: https://boringssl-review.googlesource.com/12302 CQ-Verified: CQ bot account: commit-bot@chromium.org Reviewed-by: Nick Harper Reviewed-by: David Benjamin Commit-Queue: David Benjamin --- ssl/test/runner/handshake_client.go | 1 - ssl/test/runner/handshake_messages.go | 15 ++------------- ssl/test/runner/handshake_server.go | 1 - 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/ssl/test/runner/handshake_client.go b/ssl/test/runner/handshake_client.go index f8cf1247..3f377f30 100644 --- a/ssl/test/runner/handshake_client.go +++ b/ssl/test/runner/handshake_client.go @@ -443,7 +443,6 @@ NextCipherSuite: } hello.hasEarlyData = false - hello.earlyDataContext = nil hello.raw = nil if len(hello.pskIdentities) > 0 { diff --git a/ssl/test/runner/handshake_messages.go b/ssl/test/runner/handshake_messages.go index d2d76356..8a338f0b 100644 --- a/ssl/test/runner/handshake_messages.go +++ b/ssl/test/runner/handshake_messages.go @@ -150,7 +150,6 @@ type clientHelloMsg struct { pskKEModes []byte pskBinders [][]uint8 hasEarlyData bool - earlyDataContext []byte tls13Cookie []byte ticketSupported bool sessionTicket []uint8 @@ -196,7 +195,6 @@ func (m *clientHelloMsg) equal(i interface{}) bool { bytes.Equal(m.pskKEModes, m1.pskKEModes) && eqByteSlices(m.pskBinders, m1.pskBinders) && m.hasEarlyData == m1.hasEarlyData && - bytes.Equal(m.earlyDataContext, m1.earlyDataContext) && bytes.Equal(m.tls13Cookie, m1.tls13Cookie) && m.ticketSupported == m1.ticketSupported && bytes.Equal(m.sessionTicket, m1.sessionTicket) && @@ -342,10 +340,7 @@ func (m *clientHelloMsg) marshal() []byte { } if m.hasEarlyData { extensions.addU16(extensionEarlyData) - earlyDataIndication := extensions.addU16LengthPrefixed() - - context := earlyDataIndication.addU8LengthPrefixed() - context.addBytes(m.earlyDataContext) + extensions.addU16(0) // The length is zero. } if len(m.tls13Cookie) > 0 { extensions.addU16(extensionCookie) @@ -518,7 +513,6 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool { m.keyShares = nil m.pskIdentities = nil m.hasEarlyData = false - m.earlyDataContext = nil m.ticketSupported = false m.sessionTicket = nil m.signatureAlgorithms = nil @@ -707,15 +701,10 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool { m.pskKEModes = data[1:length] case extensionEarlyData: // draft-ietf-tls-tls13 section 6.3.2.5 - if length < 1 { - return false - } - l := int(data[0]) - if length != l+1 { + if length != 0 { return false } m.hasEarlyData = true - m.earlyDataContext = data[1:length] case extensionCookie: if length < 2 { return false diff --git a/ssl/test/runner/handshake_server.go b/ssl/test/runner/handshake_server.go index 1e0d313c..738668d9 100644 --- a/ssl/test/runner/handshake_server.go +++ b/ssl/test/runner/handshake_server.go @@ -619,7 +619,6 @@ ResendHelloRetryRequest: oldClientHelloCopy := *hs.clientHello oldClientHelloCopy.raw = nil oldClientHelloCopy.hasEarlyData = false - oldClientHelloCopy.earlyDataContext = nil newClientHelloCopy := *newClientHello newClientHelloCopy.raw = nil