From 8dbd60a0951e237dd2f713a93493e4cb10fade59 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sat, 9 Sep 2017 12:43:34 +0300 Subject: [PATCH] drop support for QUIC 35 --- Changelog.md | 2 +- internal/handshake/crypto_setup_client_test.go | 4 ++-- internal/handshake/crypto_setup_server_test.go | 1 - internal/protocol/version.go | 4 +--- internal/protocol/version_test.go | 1 - internal/wire/public_header_test.go | 18 +++--------------- session_test.go | 6 +++--- 7 files changed, 10 insertions(+), 26 deletions(-) diff --git a/Changelog.md b/Changelog.md index 3716eca8..941a6d6d 100644 --- a/Changelog.md +++ b/Changelog.md @@ -2,7 +2,7 @@ ## v0.6.0 (unreleased) -- Add support for QUIC 38 and 39 +- Add support for QUIC 38 and 39, drop support for QUIC 35 - Added `quic.Config` options for maximal flow control windows - Add a `quic.Config` option for QUIC versions - Add a `quic.Config` option to request truncation of the connection ID from a server diff --git a/internal/handshake/crypto_setup_client_test.go b/internal/handshake/crypto_setup_client_test.go index e92bc1a3..7fbf0d46 100644 --- a/internal/handshake/crypto_setup_client_test.go +++ b/internal/handshake/crypto_setup_client_test.go @@ -199,9 +199,9 @@ var _ = Describe("Client Crypto Setup", func() { }) It("detects a downgrade attack", func() { - cs.negotiatedVersions = []protocol.VersionNumber{protocol.Version36} + cs.negotiatedVersions = []protocol.VersionNumber{12} b := &bytes.Buffer{} - utils.LittleEndian.WriteUint32(b, protocol.VersionNumberToTag(protocol.Version35)) + utils.LittleEndian.WriteUint32(b, protocol.VersionNumberToTag(11)) Expect(cs.validateVersionList(b.Bytes())).To(BeFalse()) }) diff --git a/internal/handshake/crypto_setup_server_test.go b/internal/handshake/crypto_setup_server_test.go index 724caa10..04aef38e 100644 --- a/internal/handshake/crypto_setup_server_test.go +++ b/internal/handshake/crypto_setup_server_test.go @@ -224,7 +224,6 @@ var _ = Describe("Server Crypto Setup", func() { Context("diversification nonce", func() { BeforeEach(func() { - cs.version = protocol.Version35 cs.secureAEAD = &mockAEAD{} cs.receivedForwardSecurePacket = false diff --git a/internal/protocol/version.go b/internal/protocol/version.go index aa1dbdfb..12cf91d8 100644 --- a/internal/protocol/version.go +++ b/internal/protocol/version.go @@ -5,8 +5,7 @@ type VersionNumber int // The version numbers, making grepping easier const ( - Version35 VersionNumber = 35 + iota - Version36 + Version36 VersionNumber = 36 + iota Version37 Version38 Version39 @@ -23,7 +22,6 @@ var SupportedVersions = []VersionNumber{ Version38, Version37, Version36, - Version35, } // UsesTLS says if this QUIC version uses TLS 1.3 for the handshake diff --git a/internal/protocol/version_test.go b/internal/protocol/version_test.go index ece2b269..fbaa2410 100644 --- a/internal/protocol/version_test.go +++ b/internal/protocol/version_test.go @@ -7,7 +7,6 @@ import ( var _ = Describe("Version", func() { It("says if a version supports TLS", func() { - Expect(Version35.UsesTLS()).To(BeFalse()) Expect(Version36.UsesTLS()).To(BeFalse()) Expect(Version37.UsesTLS()).To(BeFalse()) Expect(Version38.UsesTLS()).To(BeFalse()) diff --git a/internal/wire/public_header_test.go b/internal/wire/public_header_test.go index 3265617c..5c42f33d 100644 --- a/internal/wire/public_header_test.go +++ b/internal/wire/public_header_test.go @@ -276,7 +276,7 @@ var _ = Describe("Public Header", func() { PacketNumber: 2, PacketNumberLen: protocol.PacketNumberLen6, } - err := hdr.Write(b, protocol.Version35, protocol.PerspectiveServer) + err := hdr.Write(b, versionLittleEndian, protocol.PerspectiveServer) Expect(err).ToNot(HaveOccurred()) Expect(b.Bytes()).To(Equal([]byte{0x38, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, 2, 0, 0, 0, 0, 0})) }) @@ -288,7 +288,7 @@ var _ = Describe("Public Header", func() { PacketNumber: 0x1337, PacketNumberLen: protocol.PacketNumberLen6, } - err := hdr.Write(b, protocol.Version35, protocol.PerspectiveClient) + err := hdr.Write(b, versionLittleEndian, protocol.PerspectiveClient) Expect(err).ToNot(HaveOccurred()) Expect(b.Bytes()).To(Equal([]byte{0x38, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, 0x37, 0x13, 0, 0, 0, 0})) }) @@ -316,18 +316,6 @@ var _ = Describe("Public Header", func() { Expect(b.Bytes()).To(Equal([]byte{0x30, 0x1, 0x0, 0x0, 0x0, 0x0, 0x0})) }) - It("writes proper v33 packets", func() { - b := &bytes.Buffer{} - hdr := PublicHeader{ - ConnectionID: 0x4cfa9f9b668619f6, - PacketNumber: 1, - PacketNumberLen: protocol.PacketNumberLen1, - } - err := hdr.Write(b, protocol.Version35, protocol.PerspectiveServer) - Expect(err).ToNot(HaveOccurred()) - Expect(b.Bytes()).To(Equal([]byte{0x08, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, 0x01})) - }) - It("writes diversification nonces", func() { b := &bytes.Buffer{} hdr := PublicHeader{ @@ -336,7 +324,7 @@ var _ = Describe("Public Header", func() { PacketNumberLen: protocol.PacketNumberLen1, DiversificationNonce: bytes.Repeat([]byte{1}, 32), } - err := hdr.Write(b, protocol.Version35, protocol.PerspectiveServer) + err := hdr.Write(b, versionLittleEndian, protocol.PerspectiveServer) Expect(err).ToNot(HaveOccurred()) Expect(b.Bytes()).To(Equal([]byte{ 0x0c, 0xf6, 0x19, 0x86, 0x66, 0x9b, 0x9f, 0xfa, 0x4c, diff --git a/session_test.go b/session_test.go index 3c72f68b..5eb3921e 100644 --- a/session_test.go +++ b/session_test.go @@ -182,7 +182,7 @@ var _ = Describe("Session", func() { var pSess Session pSess, handshakeChan, err = newSession( mconn, - protocol.Version35, + protocol.Version37, 0, scfg, nil, @@ -234,7 +234,7 @@ var _ = Describe("Session", func() { } pSess, _, err := newSession( mconn, - protocol.Version35, + protocol.Version37, 0, scfg, nil, @@ -1706,7 +1706,7 @@ var _ = Describe("Client Session", func() { sessP, _, err := newClientSession( mconn, "hostname", - protocol.Version35, + protocol.Version37, 0, nil, populateClientConfig(&Config{}),