forked from quic-go/quic-go
add a function to tell if a packet is a 0-RTT packet
This commit is contained in:
@@ -29,6 +29,7 @@ func Fuzz(data []byte) int {
|
||||
if err != nil {
|
||||
return 0
|
||||
}
|
||||
is0RTTPacket := wire.Is0RTTPacket(data)
|
||||
hdr, _, _, err := wire.ParsePacket(data, connIDLen)
|
||||
if err != nil {
|
||||
return 0
|
||||
@@ -36,6 +37,9 @@ func Fuzz(data []byte) int {
|
||||
if !hdr.DestConnectionID.Equal(connID) {
|
||||
panic(fmt.Sprintf("Expected connection IDs to match: %s vs %s", hdr.DestConnectionID, connID))
|
||||
}
|
||||
if (hdr.Type == protocol.PacketType0RTT) != is0RTTPacket {
|
||||
panic("inconsistent 0-RTT packet detection")
|
||||
}
|
||||
|
||||
var extHdr *wire.ExtendedHeader
|
||||
// Parse the extended header, if this is not a Retry packet.
|
||||
|
||||
Reference in New Issue
Block a user