implement the recent changes to the version negotiation packet

This commit is contained in:
Marten Seemann 2017-12-05 07:31:12 +07:00
parent 5d900346fd
commit 45e43ada40
13 changed files with 87 additions and 100 deletions

View file

@ -19,15 +19,14 @@ var _ = Describe("Version Negotiation Packets", func() {
Expect(hdr.SupportedVersions).To(Equal(versions))
})
It("writes IETF draft style", func() {
It("writes in IETF draft style", func() {
versions := []protocol.VersionNumber{1001, 1003}
data := ComposeVersionNegotiation(0x1337, 0x42, 0x1234, versions)
data := ComposeVersionNegotiation(0x1337, 0x42, versions)
hdr, err := parseHeader(bytes.NewReader(data), protocol.PerspectiveServer)
Expect(err).ToNot(HaveOccurred())
Expect(hdr.Type).To(Equal(protocol.PacketTypeVersionNegotiation))
Expect(hdr.IsVersionNegotiation).To(BeTrue())
Expect(hdr.ConnectionID).To(Equal(protocol.ConnectionID(0x1337)))
Expect(hdr.PacketNumber).To(Equal(protocol.PacketNumber(0x42)))
Expect(hdr.Version).To(Equal(protocol.VersionNumber(0x1234)))
Expect(hdr.SupportedVersions).To(Equal(versions))
})
})