assert that no undecryptable packets are queueud after the handshake

This commit is contained in:
Marten Seemann
2020-12-11 12:17:04 +07:00
parent 02139a4743
commit c8626d89e5

View File

@@ -1674,6 +1674,9 @@ func (s *session) scheduleSending() {
}
func (s *session) tryQueueingUndecryptablePacket(p *receivedPacket, hdr *wire.Header) {
if s.handshakeComplete {
panic("shouldn't queue undecryptable packets after handshake completion")
}
if len(s.undecryptablePackets)+1 > protocol.MaxUndecryptablePackets {
if s.tracer != nil {
s.tracer.DroppedPacket(logging.PacketTypeFromHeader(hdr), p.Size(), logging.PacketDropDOSPrevention)