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 <commit-bot@chromium.org> Reviewed-by: Nick Harper <nharper@chromium.org> Reviewed-by: David Benjamin <davidben@google.com> Commit-Queue: David Benjamin <davidben@google.com>
This commit is contained in:
parent
b8d74f5b6a
commit
c5665c9ac9
@ -443,7 +443,6 @@ NextCipherSuite:
|
|||||||
}
|
}
|
||||||
|
|
||||||
hello.hasEarlyData = false
|
hello.hasEarlyData = false
|
||||||
hello.earlyDataContext = nil
|
|
||||||
hello.raw = nil
|
hello.raw = nil
|
||||||
|
|
||||||
if len(hello.pskIdentities) > 0 {
|
if len(hello.pskIdentities) > 0 {
|
||||||
|
@ -150,7 +150,6 @@ type clientHelloMsg struct {
|
|||||||
pskKEModes []byte
|
pskKEModes []byte
|
||||||
pskBinders [][]uint8
|
pskBinders [][]uint8
|
||||||
hasEarlyData bool
|
hasEarlyData bool
|
||||||
earlyDataContext []byte
|
|
||||||
tls13Cookie []byte
|
tls13Cookie []byte
|
||||||
ticketSupported bool
|
ticketSupported bool
|
||||||
sessionTicket []uint8
|
sessionTicket []uint8
|
||||||
@ -196,7 +195,6 @@ func (m *clientHelloMsg) equal(i interface{}) bool {
|
|||||||
bytes.Equal(m.pskKEModes, m1.pskKEModes) &&
|
bytes.Equal(m.pskKEModes, m1.pskKEModes) &&
|
||||||
eqByteSlices(m.pskBinders, m1.pskBinders) &&
|
eqByteSlices(m.pskBinders, m1.pskBinders) &&
|
||||||
m.hasEarlyData == m1.hasEarlyData &&
|
m.hasEarlyData == m1.hasEarlyData &&
|
||||||
bytes.Equal(m.earlyDataContext, m1.earlyDataContext) &&
|
|
||||||
bytes.Equal(m.tls13Cookie, m1.tls13Cookie) &&
|
bytes.Equal(m.tls13Cookie, m1.tls13Cookie) &&
|
||||||
m.ticketSupported == m1.ticketSupported &&
|
m.ticketSupported == m1.ticketSupported &&
|
||||||
bytes.Equal(m.sessionTicket, m1.sessionTicket) &&
|
bytes.Equal(m.sessionTicket, m1.sessionTicket) &&
|
||||||
@ -342,10 +340,7 @@ func (m *clientHelloMsg) marshal() []byte {
|
|||||||
}
|
}
|
||||||
if m.hasEarlyData {
|
if m.hasEarlyData {
|
||||||
extensions.addU16(extensionEarlyData)
|
extensions.addU16(extensionEarlyData)
|
||||||
earlyDataIndication := extensions.addU16LengthPrefixed()
|
extensions.addU16(0) // The length is zero.
|
||||||
|
|
||||||
context := earlyDataIndication.addU8LengthPrefixed()
|
|
||||||
context.addBytes(m.earlyDataContext)
|
|
||||||
}
|
}
|
||||||
if len(m.tls13Cookie) > 0 {
|
if len(m.tls13Cookie) > 0 {
|
||||||
extensions.addU16(extensionCookie)
|
extensions.addU16(extensionCookie)
|
||||||
@ -518,7 +513,6 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
|
|||||||
m.keyShares = nil
|
m.keyShares = nil
|
||||||
m.pskIdentities = nil
|
m.pskIdentities = nil
|
||||||
m.hasEarlyData = false
|
m.hasEarlyData = false
|
||||||
m.earlyDataContext = nil
|
|
||||||
m.ticketSupported = false
|
m.ticketSupported = false
|
||||||
m.sessionTicket = nil
|
m.sessionTicket = nil
|
||||||
m.signatureAlgorithms = nil
|
m.signatureAlgorithms = nil
|
||||||
@ -707,15 +701,10 @@ func (m *clientHelloMsg) unmarshal(data []byte) bool {
|
|||||||
m.pskKEModes = data[1:length]
|
m.pskKEModes = data[1:length]
|
||||||
case extensionEarlyData:
|
case extensionEarlyData:
|
||||||
// draft-ietf-tls-tls13 section 6.3.2.5
|
// draft-ietf-tls-tls13 section 6.3.2.5
|
||||||
if length < 1 {
|
if length != 0 {
|
||||||
return false
|
|
||||||
}
|
|
||||||
l := int(data[0])
|
|
||||||
if length != l+1 {
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
m.hasEarlyData = true
|
m.hasEarlyData = true
|
||||||
m.earlyDataContext = data[1:length]
|
|
||||||
case extensionCookie:
|
case extensionCookie:
|
||||||
if length < 2 {
|
if length < 2 {
|
||||||
return false
|
return false
|
||||||
|
@ -619,7 +619,6 @@ ResendHelloRetryRequest:
|
|||||||
oldClientHelloCopy := *hs.clientHello
|
oldClientHelloCopy := *hs.clientHello
|
||||||
oldClientHelloCopy.raw = nil
|
oldClientHelloCopy.raw = nil
|
||||||
oldClientHelloCopy.hasEarlyData = false
|
oldClientHelloCopy.hasEarlyData = false
|
||||||
oldClientHelloCopy.earlyDataContext = nil
|
|
||||||
newClientHelloCopy := *newClientHello
|
newClientHelloCopy := *newClientHello
|
||||||
newClientHelloCopy.raw = nil
|
newClientHelloCopy.raw = nil
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user