mirror of
https://github.com/refraction-networking/uquic.git
synced 2025-04-03 20:27:35 +03:00
when parsing the header from the invariant header, start from first byte
This will be needed once we implement header encryption, because the flags in the first byte are encrypted.
This commit is contained in:
parent
8856384b83
commit
cef26922b4
7 changed files with 55 additions and 39 deletions
|
@ -16,9 +16,9 @@ var _ = Describe("Version Negotiation Packets", func() {
|
|||
data, err := ComposeVersionNegotiation(destConnID, srcConnID, versions)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(data[0] & 0x80).ToNot(BeZero())
|
||||
b := bytes.NewReader(data)
|
||||
iHdr, err := ParseInvariantHeader(b, 4)
|
||||
iHdr, err := ParseInvariantHeader(bytes.NewReader(data), 4)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
b := bytes.NewReader(data)
|
||||
hdr, err := iHdr.Parse(b, versionIETFFrames)
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(hdr.IsVersionNegotiation).To(BeTrue())
|
||||
|
@ -30,5 +30,6 @@ var _ = Describe("Version Negotiation Packets", func() {
|
|||
for _, version := range versions {
|
||||
Expect(hdr.SupportedVersions).To(ContainElement(version))
|
||||
}
|
||||
Expect(b.Len()).To(BeZero())
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue