update master-with-bazel from master branch

This commit is contained in:
BoringSSL Robot
2024-11-15 20:34:57 +00:00
+24 -26
View File
@@ -1219,21 +1219,6 @@ ResendHelloRetryRequest:
if c.config.Bugs.SendExtraFinished {
c.writeRecord(recordTypeHandshake, finished.marshal())
}
if err := c.flushHandshake(); err != nil {
return err
}
if encryptedExtensions.extensions.hasEarlyData && !c.shouldSkipEarlyData() {
for _, expectedMsg := range config.Bugs.ExpectLateEarlyData {
if err := c.readRecord(recordTypeApplicationData); err != nil {
return err
}
if !bytes.Equal(c.input.Bytes(), expectedMsg) {
return fmt.Errorf("tls: got late early data record %x, wanted %x", c.input.Bytes(), expectedMsg)
}
c.input.Reset()
}
}
// The various secrets do not incorporate the client's final leg, so
// derive them now before updating the handshake context.
@@ -1252,19 +1237,32 @@ ResendHelloRetryRequest:
// from the client certificate are sent over these keys.
c.useOutTrafficSecret(uint16(encryptionApplication), c.wireVersion, hs.suite, serverTrafficSecret)
// Read end_of_early_data.
if encryptedExtensions.extensions.hasEarlyData && c.usesEndOfEarlyData() {
msg, err := c.readHandshake()
if err != nil {
return err
}
if err := c.flushHandshake(); err != nil {
return err
}
endOfEarlyData, ok := msg.(*endOfEarlyDataMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(endOfEarlyData, msg)
if encryptedExtensions.extensions.hasEarlyData {
for _, expectedMsg := range config.Bugs.ExpectLateEarlyData {
if err := c.readRecord(recordTypeApplicationData); err != nil {
return err
}
if !bytes.Equal(c.input.Bytes(), expectedMsg) {
return fmt.Errorf("tls: got late early data record %x, wanted %x", c.input.Bytes(), expectedMsg)
}
c.input.Reset()
}
if c.usesEndOfEarlyData() {
msg, err := c.readHandshake()
if err != nil {
return err
}
endOfEarlyData, ok := msg.(*endOfEarlyDataMsg)
if !ok {
c.sendAlert(alertUnexpectedMessage)
return unexpectedMessageError(endOfEarlyData, msg)
}
hs.writeClientHash(endOfEarlyData.marshal())
}
hs.writeClientHash(endOfEarlyData.marshal())
}
// Switch input stream to handshake traffic keys.