check that the peer updated its keys when acknowledging a key update

This commit is contained in:
Marten Seemann 2020-09-15 08:46:40 +07:00
parent 272a2c88e6
commit 9d4b4f6bf0
6 changed files with 71 additions and 15 deletions

View file

@ -51,7 +51,7 @@ type streamManager interface {
type cryptoStreamHandler interface {
RunHandshake()
ChangeConnectionID(protocol.ConnectionID)
SetLargest1RTTAcked(protocol.PacketNumber)
SetLargest1RTTAcked(protocol.PacketNumber) error
DropHandshakeKeys()
GetSessionTicket() ([]byte, error)
io.Closer
@ -1243,10 +1243,10 @@ func (s *session) handleAckFrame(frame *wire.AckFrame, encLevel protocol.Encrypt
if err := s.sentPacketHandler.ReceivedAck(frame, encLevel, s.lastPacketReceivedTime); err != nil {
return err
}
if encLevel == protocol.Encryption1RTT {
s.cryptoStreamHandler.SetLargest1RTTAcked(frame.LargestAcked())
if encLevel != protocol.Encryption1RTT {
return nil
}
return nil
return s.cryptoStreamHandler.SetLargest1RTTAcked(frame.LargestAcked())
}
// closeLocal closes the session and send a CONNECTION_CLOSE containing the error