forked from quic-go/quic-go
reject packets with version 0 sent by the client
Version 0 is an invalid version. For packets sent by the server, it is used to identify the Version Negotiation Packet.
This commit is contained in:
@@ -42,6 +42,9 @@ func parseLongHeader(b *bytes.Reader, sentBy protocol.Perspective, typeByte byte
|
||||
Version: protocol.VersionNumber(v),
|
||||
}
|
||||
if v == 0 { // version negotiation packet
|
||||
if sentBy == protocol.PerspectiveClient {
|
||||
return nil, qerr.InvalidVersion
|
||||
}
|
||||
if b.Len() == 0 {
|
||||
return nil, qerr.Error(qerr.InvalidVersionNegotiationPacket, "empty version list")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user