analyzer: make http3/quic handling more reliable
Some checks failed
Quality check / Static analysis (push) Has been cancelled
Quality check / Tests (push) Has been cancelled

This commit is contained in:
2026-02-11 15:49:32 +05:30
parent c3fe0ea16f
commit 43cb4755d0
4 changed files with 59 additions and 22 deletions

View File

@@ -55,3 +55,14 @@ func TestExtractCryptoFrames_UnknownAfterCrypto(t *testing.T) {
t.Fatalf("frame0 = %+v, want offset=0 data=abc", frames[0])
}
}
func TestReadCryptoFrames_NonInitialHeader(t *testing.T) {
// Short header packet marker should be rejected as non-initial.
_, err := ReadCryptoFrames([]byte{0x40, 0x01, 0x02, 0x03, 0x04})
if err == nil {
t.Fatal("ReadCryptoFrames() error = nil, want non-nil")
}
if err.Error() != ErrNotInitialPacket.Error() {
t.Fatalf("ReadCryptoFrames() error = %v, want %v", err, ErrNotInitialPacket)
}
}