diff --git a/http3/client_test.go b/http3/client_test.go index 16f97fd9..3f3b4a4b 100644 --- a/http3/client_test.go +++ b/http3/client_test.go @@ -55,7 +55,7 @@ var _ = Describe("Client", func() { It("rejects quic.Configs that allow multiple QUIC versions", func() { qconf := &quic.Config{ - Versions: []quic.VersionNumber{protocol.VersionDraft29, protocol.VersionDraft32}, + Versions: []quic.VersionNumber{protocol.VersionDraft29, protocol.Version1}, } _, err := newClient("localhost:1337", nil, &roundTripperOpts{}, qconf, nil) Expect(err).To(MatchError("can only use a single QUIC version for dialing a HTTP/3 connection")) diff --git a/http3/server.go b/http3/server.go index 8949b55b..ad3cdaf3 100644 --- a/http3/server.go +++ b/http3/server.go @@ -31,8 +31,6 @@ var ( const ( nextProtoH3Draft29 = "h3-29" - nextProtoH3Draft32 = "h3-32" - nextProtoH3Draft34 = "h3-34" nextProtoH3 = "h3" ) @@ -50,12 +48,6 @@ func versionToALPN(v protocol.VersionNumber) string { if v == protocol.VersionTLS || v == protocol.VersionDraft29 { return nextProtoH3Draft29 } - if v == protocol.VersionDraft32 { - return nextProtoH3Draft32 - } - if v == protocol.VersionDraft34 { - return nextProtoH3Draft34 - } return "" } @@ -159,13 +151,7 @@ func (s *Server) serveImpl(tlsConf *tls.Config, conn net.PacketConn) error { // determine the ALPN from the QUIC version used proto := nextProtoH3Draft29 if qconn, ok := ch.Conn.(handshake.ConnWithVersion); ok { - //nolint:exhaustive - switch qconn.GetQUICVersion() { - case quic.VersionDraft32: - proto = nextProtoH3Draft32 - case protocol.VersionDraft34: - proto = nextProtoH3Draft34 - case protocol.Version1: + if qconn.GetQUICVersion() == protocol.Version1 { proto = nextProtoH3 } } diff --git a/http3/server_test.go b/http3/server_test.go index 987aae1a..04896ad3 100644 --- a/http3/server_test.go +++ b/http3/server_test.go @@ -586,10 +586,10 @@ var _ = Describe("Server", func() { It("works if the quic.Config sets QUIC versions", func() { s.Server.Addr = ":443" - s.QuicConfig.Versions = []quic.VersionNumber{quic.VersionDraft32, quic.VersionDraft29} + s.QuicConfig.Versions = []quic.VersionNumber{quic.Version1, quic.VersionDraft29} hdr := http.Header{} Expect(s.SetQuicHeaders(hdr)).To(Succeed()) - Expect(hdr).To(Equal(http.Header{"Alt-Svc": {`h3-32=":443"; ma=2592000,h3-29=":443"; ma=2592000`}})) + Expect(hdr).To(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3-29=":443"; ma=2592000`}})) }) }) @@ -709,9 +709,9 @@ var _ = Describe("Server", func() { c, err := conf.GetConfigForClient(&tls.ClientHelloInfo{Conn: newMockConn(protocol.VersionDraft29)}) ExpectWithOffset(1, err).ToNot(HaveOccurred()) ExpectWithOffset(1, c.NextProtos).To(Equal([]string{nextProtoH3Draft29})) - c, err = conf.GetConfigForClient(&tls.ClientHelloInfo{Conn: newMockConn(protocol.VersionDraft32)}) + c, err = conf.GetConfigForClient(&tls.ClientHelloInfo{Conn: newMockConn(protocol.Version1)}) ExpectWithOffset(1, err).ToNot(HaveOccurred()) - ExpectWithOffset(1, c.NextProtos).To(Equal([]string{nextProtoH3Draft32})) + ExpectWithOffset(1, c.NextProtos).To(Equal([]string{nextProtoH3})) } It("uses the quic.Config to start the QUIC server", func() { diff --git a/interface.go b/interface.go index fc428afd..eb1faae5 100644 --- a/interface.go +++ b/interface.go @@ -21,10 +21,6 @@ type VersionNumber = protocol.VersionNumber const ( // VersionDraft29 is IETF QUIC draft-29 VersionDraft29 = protocol.VersionDraft29 - // VersionDraft32 is IETF QUIC draft-32 - VersionDraft32 = protocol.VersionDraft32 - // VersionDraft34 is IETF QUIC draft-34 - VersionDraft34 = protocol.VersionDraft34 // Version1 is RFC 9000 Version1 = protocol.Version1 ) diff --git a/internal/handshake/initial_aead.go b/internal/handshake/initial_aead.go index f272297d..2880acf3 100644 --- a/internal/handshake/initial_aead.go +++ b/internal/handshake/initial_aead.go @@ -11,13 +11,13 @@ import ( ) var ( - quicSaltOld = []byte{0xaf, 0xbf, 0xec, 0x28, 0x99, 0x93, 0xd2, 0x4c, 0x9e, 0x97, 0x86, 0xf1, 0x9c, 0x61, 0x11, 0xe0, 0x43, 0x90, 0xa8, 0x99} - quicSaltDraft34 = []byte{0x38, 0x76, 0x2c, 0xf7, 0xf5, 0x59, 0x34, 0xb3, 0x4d, 0x17, 0x9a, 0xe6, 0xa4, 0xc8, 0x0c, 0xad, 0xcc, 0xbb, 0x7f, 0x0a} + quicSaltOld = []byte{0xaf, 0xbf, 0xec, 0x28, 0x99, 0x93, 0xd2, 0x4c, 0x9e, 0x97, 0x86, 0xf1, 0x9c, 0x61, 0x11, 0xe0, 0x43, 0x90, 0xa8, 0x99} + quicSalt = []byte{0x38, 0x76, 0x2c, 0xf7, 0xf5, 0x59, 0x34, 0xb3, 0x4d, 0x17, 0x9a, 0xe6, 0xa4, 0xc8, 0x0c, 0xad, 0xcc, 0xbb, 0x7f, 0x0a} ) func getSalt(v protocol.VersionNumber) []byte { - if v == protocol.VersionDraft34 || v == protocol.Version1 { - return quicSaltDraft34 + if v == protocol.Version1 { + return quicSalt } return quicSaltOld } diff --git a/internal/handshake/initial_aead_test.go b/internal/handshake/initial_aead_test.go index 1d628107..acabd920 100644 --- a/internal/handshake/initial_aead_test.go +++ b/internal/handshake/initial_aead_test.go @@ -72,8 +72,8 @@ var _ = Describe("Initial AEAD using AES-GCM", func() { }) // values taken from the Appendix of the draft - Context("using the test vector from the QUIC draft, for QUIC draft-34", func() { - const version = protocol.VersionDraft34 + Context("using the test vector from the QUIC draft, for QUIC v1", func() { + const version = protocol.Version1 var connID protocol.ConnectionID BeforeEach(func() { @@ -125,7 +125,7 @@ var _ = Describe("Initial AEAD using AES-GCM", func() { }) }) - for _, ver := range []protocol.VersionNumber{protocol.VersionDraft32, protocol.VersionDraft34} { + for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.Version1} { v := ver Context(fmt.Sprintf("using version %s", v), func() { diff --git a/internal/handshake/retry.go b/internal/handshake/retry.go index d23c993e..b7cb20c1 100644 --- a/internal/handshake/retry.go +++ b/internal/handshake/retry.go @@ -48,7 +48,7 @@ func GetRetryIntegrityTag(retry []byte, origDestConnID protocol.ConnectionID, ve var tag [16]byte var sealed []byte - if version != protocol.VersionDraft34 && version != protocol.Version1 { + if version != protocol.Version1 { sealed = oldRetryAEAD.Seal(tag[:0], oldRetryNonce[:], nil, retryBuf.Bytes()) } else { sealed = retryAEAD.Seal(tag[:0], retryNonce[:], nil, retryBuf.Bytes()) diff --git a/internal/handshake/retry_test.go b/internal/handshake/retry_test.go index 86c36c36..e1d3a215 100644 --- a/internal/handshake/retry_test.go +++ b/internal/handshake/retry_test.go @@ -17,8 +17,8 @@ var _ = Describe("Retry Integrity Check", func() { }) It("includes the original connection ID in the tag calculation", func() { - t1 := GetRetryIntegrityTag([]byte("foobar"), protocol.ConnectionID{1, 2, 3, 4}, protocol.VersionDraft34) - t2 := GetRetryIntegrityTag([]byte("foobar"), protocol.ConnectionID{4, 3, 2, 1}, protocol.VersionDraft34) + t1 := GetRetryIntegrityTag([]byte("foobar"), protocol.ConnectionID{1, 2, 3, 4}, protocol.Version1) + t2 := GetRetryIntegrityTag([]byte("foobar"), protocol.ConnectionID{4, 3, 2, 1}, protocol.Version1) Expect(*t1).ToNot(Equal(*t2)) }) @@ -28,9 +28,9 @@ var _ = Describe("Retry Integrity Check", func() { Expect(GetRetryIntegrityTag(data[:len(data)-16], connID, protocol.VersionDraft29)[:]).To(Equal(data[len(data)-16:])) }) - It("uses the test vector from the draft, for draft-34", func() { + It("uses the test vector from the draft, for version 1", func() { connID := protocol.ConnectionID(splitHexString("0x8394c8f03e515708")) data := splitHexString("ff000000010008f067a5502a4262b574 6f6b656e04a265ba2eff4d829058fb3f 0f2496ba") - Expect(GetRetryIntegrityTag(data[:len(data)-16], connID, protocol.VersionDraft34)[:]).To(Equal(data[len(data)-16:])) + Expect(GetRetryIntegrityTag(data[:len(data)-16], connID, protocol.Version1)[:]).To(Equal(data[len(data)-16:])) }) }) diff --git a/internal/handshake/tls_extension_handler.go b/internal/handshake/tls_extension_handler.go index 8f344f08..3a679034 100644 --- a/internal/handshake/tls_extension_handler.go +++ b/internal/handshake/tls_extension_handler.go @@ -24,7 +24,7 @@ var _ tlsExtensionHandler = &extensionHandler{} // newExtensionHandler creates a new extension handler func newExtensionHandler(params []byte, pers protocol.Perspective, v protocol.VersionNumber) tlsExtensionHandler { et := uint16(quicTLSExtensionType) - if v != protocol.VersionDraft34 && v != protocol.Version1 { + if v != protocol.Version1 { et = quicTLSExtensionTypeOldDrafts } return &extensionHandler{ diff --git a/internal/handshake/tls_extension_handler_test.go b/internal/handshake/tls_extension_handler_test.go index 33e9a4c8..23b99ced 100644 --- a/internal/handshake/tls_extension_handler_test.go +++ b/internal/handshake/tls_extension_handler_test.go @@ -35,7 +35,7 @@ var _ = Describe("TLS Extension Handler, for the server", func() { }) Context("for the server", func() { - for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.VersionDraft34} { + for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.Version1} { v := ver Context(fmt.Sprintf("sending, for version %s", v), func() { @@ -122,7 +122,7 @@ var _ = Describe("TLS Extension Handler, for the server", func() { }) Context("for the client", func() { - for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.VersionDraft34} { + for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.Version1} { v := ver Context(fmt.Sprintf("sending, for version %s", v), func() { diff --git a/internal/protocol/version.go b/internal/protocol/version.go index c3929134..b5276303 100644 --- a/internal/protocol/version.go +++ b/internal/protocol/version.go @@ -22,14 +22,12 @@ const ( VersionWhatever VersionNumber = math.MaxUint32 - 1 // for when the version doesn't matter VersionUnknown VersionNumber = math.MaxUint32 VersionDraft29 VersionNumber = 0xff00001d - VersionDraft32 VersionNumber = 0xff000020 - VersionDraft34 VersionNumber = 0xff000022 Version1 VersionNumber = 0x1 ) // SupportedVersions lists the versions that the server supports // must be in sorted descending order -var SupportedVersions = []VersionNumber{Version1, VersionDraft34, VersionDraft32, VersionDraft29} +var SupportedVersions = []VersionNumber{Version1, VersionDraft29} // IsValidVersion says if the version is known to quic-go func IsValidVersion(v VersionNumber) bool { @@ -39,7 +37,7 @@ func IsValidVersion(v VersionNumber) bool { func (vn VersionNumber) String() string { // For releases, VersionTLS will be set to a draft version. // A switch statement can't contain duplicate cases. - if vn == VersionTLS && VersionTLS != VersionDraft29 && VersionTLS != VersionDraft32 && VersionTLS != Version1 { + if vn == VersionTLS && VersionTLS != VersionDraft29 && VersionTLS != Version1 { return "TLS dev version (WIP)" } //nolint:exhaustive @@ -50,10 +48,6 @@ func (vn VersionNumber) String() string { return "unknown" case VersionDraft29: return "draft-29" - case VersionDraft32: - return "draft-32" - case VersionDraft34: - return "draft-34" case Version1: return "v1" default: diff --git a/internal/protocol/version_test.go b/internal/protocol/version_test.go index 7b24c2cb..17c067b8 100644 --- a/internal/protocol/version_test.go +++ b/internal/protocol/version_test.go @@ -15,8 +15,6 @@ var _ = Describe("Version", func() { Expect(IsValidVersion(VersionWhatever)).To(BeFalse()) Expect(IsValidVersion(VersionUnknown)).To(BeFalse()) Expect(IsValidVersion(VersionDraft29)).To(BeTrue()) - Expect(IsValidVersion(VersionDraft32)).To(BeTrue()) - Expect(IsValidVersion(VersionDraft34)).To(BeTrue()) Expect(IsValidVersion(Version1)).To(BeTrue()) Expect(IsValidVersion(1234)).To(BeFalse()) }) @@ -29,8 +27,6 @@ var _ = Describe("Version", func() { Expect(VersionWhatever.String()).To(Equal("whatever")) Expect(VersionUnknown.String()).To(Equal("unknown")) Expect(VersionDraft29.String()).To(Equal("draft-29")) - Expect(VersionDraft32.String()).To(Equal("draft-32")) - Expect(VersionDraft34.String()).To(Equal("draft-34")) Expect(Version1.String()).To(Equal("v1")) // check with unsupported version numbers from the wiki Expect(VersionNumber(0x51303039).String()).To(Equal("gQUIC 9"))