forked from quic-go/quic-go
keep undecryptable packets when deriving 0-RTT and handshake keys (#4950)
When receiving a ClientHello for a 0-RTT connection, this allows us to derive both 0-RTT and Handshake keys at the same time. The previous logic used to inadvertently discard previously undecryptable packets (e.g. reordered 0-RTT packets).
This commit is contained in:
@@ -1553,8 +1553,8 @@ func (s *connection) handleHandshakeEvents(now time.Time) error {
|
||||
s.restoreTransportParameters(ev.TransportParameters)
|
||||
close(s.earlyConnReadyChan)
|
||||
case handshake.EventReceivedReadKeys:
|
||||
// Queue all packets for decryption that have been undecryptable so far.
|
||||
s.undecryptablePacketsToProcess = s.undecryptablePackets
|
||||
// queue all previously undecryptable packets
|
||||
s.undecryptablePacketsToProcess = append(s.undecryptablePacketsToProcess, s.undecryptablePackets...)
|
||||
s.undecryptablePackets = nil
|
||||
case handshake.EventDiscard0RTTKeys:
|
||||
err = s.dropEncryptionLevel(protocol.Encryption0RTT, now)
|
||||
|
||||
Reference in New Issue
Block a user