wire: implement parsing and writing of the ACK_FREQUENCY frame (#5264)

* implement parsing and writing of the ACK_FREQUENCY frame

* prevent overflows of Request Max Ack Delay

* fix fuzzer
This commit is contained in:
Marten Seemann
2025-07-21 09:35:06 -04:00
committed by GitHub
parent c2e784aaf2
commit 06e31852cb
9 changed files with 186 additions and 26 deletions

View File

@@ -35,7 +35,7 @@ func Fuzz(data []byte) int {
encLevel := toEncLevel(data[0])
data = data[PrefixLen:]
parser := wire.NewFrameParser(true, true)
parser := wire.NewFrameParser(true, true, true)
parser.SetAckDelayExponent(protocol.DefaultAckDelayExponent)
var numFrames int
@@ -153,5 +153,9 @@ func validateFrame(frame wire.Frame) {
if f.FinalSize < f.ReliableSize {
panic("RESET_STREAM frame with a FinalSize smaller than the ReliableSize")
}
case *wire.AckFrequencyFrame:
if f.RequestMaxAckDelay < 0 {
panic("ACK_FREQUENCY frame with a negative RequestMaxAckDelay")
}
}
}