forked from quic-go/quic-go
don't queue a packet for later decryption of decryption already failed
This was an optimization in gQUIC, which relied on trial decryption. In IETF QUIC, we know with certainty which keys were used to encrypt a packet, so if decryption fails once, we are certain it will never succeed.
This commit is contained in:
@@ -99,7 +99,7 @@ func (u *packetUnpacker) Unpack(hdr *wire.Header, data []byte) (*unpackedPacket,
|
||||
|
||||
decrypted, err := opener.Open(buf, data, pn, extHdr.Raw)
|
||||
if err != nil {
|
||||
return nil, qerr.Error(qerr.DecryptionFailure, err.Error())
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Only do this after decrypting, so we are sure the packet is not attacker-controlled
|
||||
|
||||
Reference in New Issue
Block a user