reject packets with truncated connection ID, if truncation was disabled

This commit is contained in:
Marten Seemann
2017-09-16 13:53:42 +07:00
parent 8015160cf9
commit ca5a8d0792
2 changed files with 19 additions and 1 deletions

View File

@@ -253,6 +253,10 @@ func (c *client) handlePacket(remoteAddr net.Addr, packet []byte) {
// drop this packet if we can't parse the Public Header
return
}
// reject packets with truncated connection id if we didn't request truncation
if hdr.TruncateConnectionID && !c.config.RequestConnectionIDTruncation {
return
}
hdr.Raw = packet[:len(packet)-r.Len()]
c.mutex.Lock()