remove the LongHeader field from the wire.Header

This commit is contained in:
Marten Seemann
2022-12-27 12:03:38 +13:00
parent aca052dc7c
commit 86edf7fd4b
23 changed files with 154 additions and 363 deletions

View File

@@ -30,8 +30,14 @@ func Fuzz(data []byte) int {
if err != nil {
return 0
}
if !wire.IsLongHeaderPacket(data[0]) {
wire.ParseShortHeader(data, connIDLen)
return 1
}
is0RTTPacket := wire.Is0RTTPacket(data)
hdr, _, _, err := wire.ParsePacket(data, connIDLen)
hdr, _, _, err := wire.ParsePacket(data)
if err != nil {
return 0
}
@@ -42,11 +48,6 @@ func Fuzz(data []byte) int {
panic("inconsistent 0-RTT packet detection")
}
if !wire.IsLongHeaderPacket(data[0]) {
wire.ParseShortHeader(data, connIDLen)
return 1
}
var extHdr *wire.ExtendedHeader
// Parse the extended header, if this is not a Retry packet.
if hdr.Type == protocol.PacketTypeRetry {
@@ -60,7 +61,7 @@ func Fuzz(data []byte) int {
}
// We always use a 2-byte encoding for the Length field in Long Header packets.
// Serializing the header will fail when using a higher value.
if hdr.IsLongHeader && hdr.Length > 16383 {
if hdr.Length > 16383 {
return 1
}
b := &bytes.Buffer{}