Skip to content

Commit

Permalink
drop support for draft-29 (#3903)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann committed Jun 21, 2023
1 parent da298d0 commit 21388c8
Show file tree
Hide file tree
Showing 20 changed files with 65 additions and 189 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/integration.yml
Expand Up @@ -25,9 +25,6 @@ jobs:
run: |
go run github.com/onsi/ginkgo/v2/ginkgo -r -v -randomize-all -randomize-suites -trace -skip-package self,versionnegotiation integrationtests
go run github.com/onsi/ginkgo/v2/ginkgo -r -v -randomize-all -randomize-suites -trace integrationtests/versionnegotiation -- ${{ env.QLOGFLAG }}
- name: Run self tests, using draft-29
if: success() || failure() # run this step even if the previous one failed
run: go run github.com/onsi/ginkgo/v2/ginkgo -r -v -randomize-all -randomize-suites -trace integrationtests/self -- -version=draft29 ${{ env.QLOGFLAG }}
- name: Run self tests, using QUIC v1
if: success() || failure() # run this step even if the previous one failed
run: go run github.com/onsi/ginkgo/v2/ginkgo -r -v -randomize-all -randomize-suites -trace integrationtests/self -- -version=1 ${{ env.QLOGFLAG }}
Expand Down
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -12,10 +12,6 @@ In addition to these base RFCs, it also implements the following RFCs:
* Datagram Packetization Layer Path MTU Discovery (DPLPMTUD, [RFC 8899](https://datatracker.ietf.org/doc/html/rfc8899))
* QUIC Version 2 ([RFC 9369](https://datatracker.ietf.org/doc/html/rfc9369))

In addition to the RFCs listed above, it currently implements the [IETF QUIC draft-29](https://tools.ietf.org/html/draft-ietf-quic-transport-29). Support for draft-29 will eventually be dropped, as it is phased out of the ecosystem.

This repository provides both a QUIC implementation, located in the `quic` package, as well as an HTTP/3 implementation, located in the `http3` package.

## Using QUIC

### Running a Server
Expand Down
2 changes: 1 addition & 1 deletion http3/client_test.go
Expand Up @@ -54,7 +54,7 @@ var _ = Describe("Client", func() {

It("rejects quic.Configs that allow multiple QUIC versions", func() {
qconf := &quic.Config{
Versions: []quic.VersionNumber{protocol.VersionDraft29, protocol.Version1},
Versions: []quic.VersionNumber{protocol.Version2, 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"))
Expand Down
2 changes: 0 additions & 2 deletions http3/server.go
Expand Up @@ -62,8 +62,6 @@ func versionToALPN(v protocol.VersionNumber) string {
switch v {
case protocol.Version1, protocol.Version2:
return NextProtoH3
case protocol.VersionDraft29:
return NextProtoH3Draft29
default:
return ""
}
Expand Down
25 changes: 7 additions & 18 deletions http3/server_test.go
Expand Up @@ -779,13 +779,13 @@ var _ = Describe("Server", func() {

Context("setting http headers", func() {
BeforeEach(func() {
s.QuicConfig = &quic.Config{Versions: []protocol.VersionNumber{protocol.VersionDraft29}}
s.QuicConfig = &quic.Config{Versions: []protocol.VersionNumber{protocol.Version1}}
})

var ln1 QUICEarlyListener
var ln2 QUICEarlyListener
expected := http.Header{
"Alt-Svc": {`h3-29=":443"; ma=2592000`},
"Alt-Svc": {`h3=":443"; ma=2592000`},
}

addListener := func(addr string, ln *QUICEarlyListener) {
Expand Down Expand Up @@ -840,17 +840,17 @@ var _ = Describe("Server", func() {
})

It("works if the quic.Config sets QUIC versions", func() {
s.QuicConfig.Versions = []quic.VersionNumber{quic.Version1, quic.VersionDraft29}
s.QuicConfig.Versions = []quic.VersionNumber{quic.Version1, quic.Version2}
addListener(":443", &ln1)
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3-29=":443"; ma=2592000`}}))
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000`}}))
removeListener(&ln1)
checkSetHeaderError()
})

It("uses s.Port if set to a non-zero value", func() {
s.Port = 8443
addListener(":443", &ln1)
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3-29=":8443"; ma=2592000`}}))
checkSetHeaders(Equal(http.Header{"Alt-Svc": {`h3=":8443"; ma=2592000`}}))
removeListener(&ln1)
checkSetHeaderError()
})
Expand All @@ -870,8 +870,8 @@ var _ = Describe("Server", func() {
addListener(":443", &ln1)
addListener(":8443", &ln2)
checkSetHeaders(Or(
Equal(http.Header{"Alt-Svc": {`h3-29=":443"; ma=2592000,h3-29=":8443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3-29=":8443"; ma=2592000,h3-29=":443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3=":443"; ma=2592000,h3=":8443"; ma=2592000`}}),
Equal(http.Header{"Alt-Svc": {`h3=":8443"; ma=2592000,h3=":443"; ma=2592000`}}),
))
removeListener(&ln1)
removeListener(&ln2)
Expand Down Expand Up @@ -929,17 +929,6 @@ var _ = Describe("Server", func() {
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3))
})

It("advertises h3-29 for draft-29", func() {
conf := ConfigureTLSConfig(testdata.GetTLSConfig())
ln, err := quic.ListenAddr("localhost:0", conf, &quic.Config{Versions: []quic.VersionNumber{quic.VersionDraft29}})
Expect(err).ToNot(HaveOccurred())
defer ln.Close()
c, err := quic.DialAddr(context.Background(), ln.Addr().String(), &tls.Config{InsecureSkipVerify: true, NextProtos: []string{NextProtoH3Draft29}}, nil)
Expect(err).ToNot(HaveOccurred())
defer c.CloseWithError(0, "")
Expect(c.ConnectionState().TLS.ConnectionState.NegotiatedProtocol).To(Equal(NextProtoH3Draft29))
})

It("sets the GetConfigForClient callback if no tls.Config is given", func() {
var receivedConf *tls.Config
quicListenAddr = func(addr string, tlsConf *tls.Config, _ *quic.Config) (QUICEarlyListener, error) {
Expand Down
7 changes: 1 addition & 6 deletions integrationtests/self/http_test.go
Expand Up @@ -18,7 +18,6 @@ import (

"github.com/quic-go/quic-go"
"github.com/quic-go/quic-go/http3"
"github.com/quic-go/quic-go/internal/protocol"

. "github.com/onsi/ginkgo/v2"
. "github.com/onsi/gomega"
Expand Down Expand Up @@ -397,11 +396,7 @@ var _ = Describe("HTTP tests", func() {

It("serves other QUIC connections", func() {
tlsConf := getTLSConfig()
if version == protocol.VersionDraft29 {
tlsConf.NextProtos = []string{http3.NextProtoH3Draft29}
} else {
tlsConf.NextProtos = []string{http3.NextProtoH3}
}
tlsConf.NextProtos = []string{http3.NextProtoH3}
ln, err := quic.ListenAddr("localhost:0", tlsConf, nil)
Expect(err).ToNot(HaveOccurred())
defer ln.Close()
Expand Down
2 changes: 0 additions & 2 deletions integrationtests/self/self_suite_test.go
Expand Up @@ -149,8 +149,6 @@ var _ = BeforeSuite(func() {
version = quic.Version1
case "2":
version = quic.Version2
case "draft29":
version = quic.VersionDraft29
default:
Fail(fmt.Sprintf("unknown QUIC version: %s", versionParam))
}
Expand Down
3 changes: 1 addition & 2 deletions interface.go
Expand Up @@ -19,10 +19,9 @@ type StreamID = protocol.StreamID
type VersionNumber = protocol.VersionNumber

const (
// VersionDraft29 is IETF QUIC draft-29
VersionDraft29 = protocol.VersionDraft29
// Version1 is RFC 9000
Version1 = protocol.Version1
// Version2 is RFC 9369
Version2 = protocol.Version2
)

Expand Down
2 changes: 1 addition & 1 deletion internal/handshake/aead_test.go
Expand Up @@ -15,7 +15,7 @@ import (
)

var _ = Describe("Long Header AEAD", func() {
for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.Version1, protocol.Version2} {
for _, ver := range []protocol.VersionNumber{protocol.Version1, protocol.Version2} {
v := ver

Context(fmt.Sprintf("using version %s", v), func() {
Expand Down
2 changes: 1 addition & 1 deletion internal/handshake/crypto_setup.go
Expand Up @@ -240,7 +240,7 @@ func newCryptoSetup(
tracer.UpdatedKeyFromTLS(protocol.EncryptionInitial, protocol.PerspectiveClient)
tracer.UpdatedKeyFromTLS(protocol.EncryptionInitial, protocol.PerspectiveServer)
}
extHandler := newExtensionHandler(tp.Marshal(perspective), perspective, version)
extHandler := newExtensionHandler(tp.Marshal(perspective), perspective)
zeroRTTParametersChan := make(chan *wire.TransportParameters, 1)
cs := &cryptoSetup{
tlsConf: tlsConf,
Expand Down
10 changes: 3 additions & 7 deletions internal/handshake/initial_aead.go
Expand Up @@ -11,9 +11,8 @@ import (
)

var (
quicSaltOld = []byte{0xaf, 0xbf, 0xec, 0x28, 0x99, 0x93, 0xd2, 0x4c, 0x9e, 0x97, 0x86, 0xf1, 0x9c, 0x61, 0x11, 0xe0, 0x43, 0x90, 0xa8, 0x99}
quicSaltV1 = []byte{0x38, 0x76, 0x2c, 0xf7, 0xf5, 0x59, 0x34, 0xb3, 0x4d, 0x17, 0x9a, 0xe6, 0xa4, 0xc8, 0x0c, 0xad, 0xcc, 0xbb, 0x7f, 0x0a}
quicSaltV2 = []byte{0x0d, 0xed, 0xe3, 0xde, 0xf7, 0x00, 0xa6, 0xdb, 0x81, 0x93, 0x81, 0xbe, 0x6e, 0x26, 0x9d, 0xcb, 0xf9, 0xbd, 0x2e, 0xd9}
quicSaltV1 = []byte{0x38, 0x76, 0x2c, 0xf7, 0xf5, 0x59, 0x34, 0xb3, 0x4d, 0x17, 0x9a, 0xe6, 0xa4, 0xc8, 0x0c, 0xad, 0xcc, 0xbb, 0x7f, 0x0a}
quicSaltV2 = []byte{0x0d, 0xed, 0xe3, 0xde, 0xf7, 0x00, 0xa6, 0xdb, 0x81, 0x93, 0x81, 0xbe, 0x6e, 0x26, 0x9d, 0xcb, 0xf9, 0xbd, 0x2e, 0xd9}
)

const (
Expand All @@ -27,10 +26,7 @@ func getSalt(v protocol.VersionNumber) []byte {
if v == protocol.Version2 {
return quicSaltV2
}
if v == protocol.Version1 {
return quicSaltV1
}
return quicSaltOld
return quicSaltV1
}

var initialSuite = &qtls.CipherSuiteTLS13{
Expand Down
31 changes: 1 addition & 30 deletions internal/handshake/initial_aead_test.go
Expand Up @@ -27,12 +27,6 @@ var _ = Describe("Initial AEAD using AES-GCM", func() {
Expect(key).To(Equal(expectedKey))
Expect(iv).To(Equal(expectedIV))
},
Entry("draft-29",
protocol.VersionDraft29,
splitHexString("0088119288f1d866733ceeed15ff9d50 902cf82952eee27e9d4d4918ea371d87"),
splitHexString("175257a31eb09dea9366d8bb79ad80ba"),
splitHexString("6b26114b9cba2b63a9e8dd4f"),
),
Entry("QUIC v1",
protocol.Version1,
splitHexString("c00cf151ca5be075ed0ebfb5c80323c4 2d6b7db67881289af4008f1f6c357aea"),
Expand All @@ -55,12 +49,6 @@ var _ = Describe("Initial AEAD using AES-GCM", func() {
Expect(key).To(Equal(expectedKey))
Expect(iv).To(Equal(expectedIV))
},
Entry("draft 29",
protocol.VersionDraft29,
splitHexString("006f881359244dd9ad1acf85f595bad6 7c13f9f5586f5e64e1acae1d9ea8f616"),
splitHexString("149d0b1662ab871fbe63c49b5e655a5d"),
splitHexString("bab2b12a4c76016ace47856d"),
),
Entry("QUIC v1",
protocol.Version1,
splitHexString("3c199828fd139efd216c155ad844cc81 fb82fa8d7446fa7d78be803acdda951b"),
Expand Down Expand Up @@ -88,15 +76,6 @@ var _ = Describe("Initial AEAD using AES-GCM", func() {
packet := append(header, sealed...)
Expect(packet).To(Equal(expectedPacket))
},
Entry("draft-29",
protocol.VersionDraft29,
splitHexString("c3ff00001d088394c8f03e5157080000449e00000002"),
splitHexString("060040c4010000c003036660261ff947 cea49cce6cfad687f457cf1b14531ba1 4131a0e8f309a1d0b9c4000006130113 031302010000910000000b0009000006 736572766572ff01000100000a001400 12001d00170018001901000101010201 03010400230000003300260024001d00 204cfdfcd178b784bf328cae793b136f 2aedce005ff183d7bb14952072366470 37002b0003020304000d0020001e0403 05030603020308040805080604010501 060102010402050206020202002d0002 0101001c00024001"),
splitHexString("fb66bc5f93032b7ddd89fe0ff15d9c4f"),
byte(0xc5),
splitHexString("4a95245b"),
splitHexString("c5ff00001d088394c8f03e5157080000 449e4a95245bfb66bc5f93032b7ddd89 fe0ff15d9c4f7050fccdb71c1cd80512 d4431643a53aafa1b0b518b44968b18b 8d3e7a4d04c30b3ed9410325b2abb2da fb1c12f8b70479eb8df98abcaf95dd8f 3d1c78660fbc719f88b23c8aef6771f3 d50e10fdfb4c9d92386d44481b6c52d5 9e5538d3d3942de9f13a7f8b702dc317 24180da9df22714d01003fc5e3d165c9 50e630b8540fbd81c9df0ee63f949970 26c4f2e1887a2def79050ac2d86ba318 e0b3adc4c5aa18bcf63c7cf8e85f5692 49813a2236a7e72269447cd1c755e451 f5e77470eb3de64c8849d29282069802 9cfa18e5d66176fe6e5ba4ed18026f90 900a5b4980e2f58e39151d5cd685b109 29636d4f02e7fad2a5a458249f5c0298 a6d53acbe41a7fc83fa7cc01973f7a74 d1237a51974e097636b6203997f921d0 7bc1940a6f2d0de9f5a11432946159ed 6cc21df65c4ddd1115f86427259a196c 7148b25b6478b0dc7766e1c4d1b1f515 9f90eabc61636226244642ee148b464c 9e619ee50a5e3ddc836227cad938987c 4ea3c1fa7c75bbf88d89e9ada642b2b8 8fe8107b7ea375b1b64889a4e9e5c38a 1c896ce275a5658d250e2d76e1ed3a34 ce7e3a3f383d0c996d0bed106c2899ca 6fc263ef0455e74bb6ac1640ea7bfedc 59f03fee0e1725ea150ff4d69a7660c5 542119c71de270ae7c3ecfd1af2c4ce5 51986949cc34a66b3e216bfe18b347e6 c05fd050f85912db303a8f054ec23e38 f44d1c725ab641ae929fecc8e3cefa56 19df4231f5b4c009fa0c0bbc60bc75f7 6d06ef154fc8577077d9d6a1d2bd9bf0 81dc783ece60111bea7da9e5a9748069 d078b2bef48de04cabe3755b197d52b3 2046949ecaa310274b4aac0d008b1948 c1082cdfe2083e386d4fd84c0ed0666d 3ee26c4515c4fee73433ac703b690a9f 7bf278a77486ace44c489a0c7ac8dfe4 d1a58fb3a730b993ff0f0d61b4d89557 831eb4c752ffd39c10f6b9f46d8db278 da624fd800e4af85548a294c1518893a 8778c4f6d6d73c93df200960104e062b 388ea97dcf4016bced7f62b4f062cb6c 04c20693d9a0e3b74ba8fe74cc012378 84f40d765ae56a51688d985cf0ceaef4 3045ed8c3f0c33bced08537f6882613a cd3b08d665fce9dd8aa73171e2d3771a 61dba2790e491d413d93d987e2745af2 9418e428be34941485c93447520ffe23 1da2304d6a0fd5d07d08372202369661 59bef3cf904d722324dd852513df39ae 030d8173908da6364786d3c1bfcb19ea 77a63b25f1e7fc661def480c5d00d444 56269ebd84efd8e3a8b2c257eec76060 682848cbf5194bc99e49ee75e4d0d254 bad4bfd74970c30e44b65511d4ad0e6e c7398e08e01307eeeea14e46ccd87cf3 6b285221254d8fc6a6765c524ded0085 dca5bd688ddf722e2c0faf9d0fb2ce7a 0c3f2cee19ca0ffba461ca8dc5d2c817 8b0762cf67135558494d2a96f1a139f0 edb42d2af89a9c9122b07acbc29e5e72 2df8615c343702491098478a389c9872 a10b0c9875125e257c7bfdf27eef4060 bd3d00f4c14fd3e3496c38d3c5d1a566 8c39350effbc2d16ca17be4ce29f02ed 969504dda2a8c6b9ff919e693ee79e09 089316e7d1d89ec099db3b2b268725d8 88536a4b8bf9aee8fb43e82a4d919d48 43b1ca70a2d8d3f725ead1391377dcc0"),
),
Entry("QUIC v1",
protocol.Version1,
splitHexString("c300000001088394c8f03e5157080000449e00000002"),
Expand Down Expand Up @@ -128,14 +107,6 @@ var _ = Describe("Initial AEAD using AES-GCM", func() {
packet := append(header, sealed...)
Expect(packet).To(Equal(expectedPacket))
},
Entry("draft 29",
protocol.VersionDraft29,
splitHexString("c1ff00001d0008f067a5502a4262b50040740001"),
splitHexString("0d0000000018410a020000560303eefc e7f7b37ba1d1632e96677825ddf73988 cfc79825df566dc5430b9a045a120013 0100002e00330024001d00209d3c940d 89690b84d08a60993c144eca684d1081 287c834d5311bcf32bb9da1a002b0002 0304"),
splitHexString("823a5d3a1207c86ee49132824f046524"),
splitHexString("caff00001d0008f067a5502a4262b5004074aaf2"),
splitHexString("caff00001d0008f067a5502a4262b500 4074aaf2f007823a5d3a1207c86ee491 32824f0465243d082d868b107a38092b c80528664cbf9456ebf27673fb5fa506 1ab573c9f001b81da028a00d52ab00b1 5bebaa70640e106cf2acd043e9c6b441 1c0a79637134d8993701fe779e58c2fe 753d14b0564021565ea92e57bc6faf56 dfc7a40870e6"),
),
Entry("QUIC v1",
protocol.Version1,
splitHexString("c1000000010008f067a5502a4262b50040750001"),
Expand All @@ -154,7 +125,7 @@ var _ = Describe("Initial AEAD using AES-GCM", func() {
),
)

for _, ver := range []protocol.VersionNumber{protocol.VersionDraft29, protocol.Version1, protocol.Version2} {
for _, ver := range []protocol.VersionNumber{protocol.Version1, protocol.Version2} {
v := ver

Context(fmt.Sprintf("using version %s", v), func() {
Expand Down
25 changes: 9 additions & 16 deletions internal/handshake/retry.go
Expand Up @@ -11,13 +11,11 @@ import (
)

var (
retryAEADdraft29 cipher.AEAD // used for QUIC draft versions up to 34
retryAEADv1 cipher.AEAD // used for QUIC v1 (RFC 9000)
retryAEADv2 cipher.AEAD // used for QUIC v2
retryAEADv1 cipher.AEAD // used for QUIC v1 (RFC 9000)
retryAEADv2 cipher.AEAD // used for QUIC v2 (RFC 9369)
)

func init() {
retryAEADdraft29 = initAEAD([16]byte{0xcc, 0xce, 0x18, 0x7e, 0xd0, 0x9a, 0x09, 0xd0, 0x57, 0x28, 0x15, 0x5a, 0x6c, 0xb9, 0x6b, 0xe1})
retryAEADv1 = initAEAD([16]byte{0xbe, 0x0c, 0x69, 0x0b, 0x9f, 0x66, 0x57, 0x5a, 0x1d, 0x76, 0x6b, 0x54, 0xe3, 0x68, 0xc8, 0x4e})
retryAEADv2 = initAEAD([16]byte{0x8f, 0xb4, 0xb0, 0x1b, 0x56, 0xac, 0x48, 0xe2, 0x60, 0xfb, 0xcb, 0xce, 0xad, 0x7c, 0xcc, 0x92})
}
Expand All @@ -35,11 +33,10 @@ func initAEAD(key [16]byte) cipher.AEAD {
}

var (
retryBuf bytes.Buffer
retryMutex sync.Mutex
retryNonceDraft29 = [12]byte{0xe5, 0x49, 0x30, 0xf9, 0x7f, 0x21, 0x36, 0xf0, 0x53, 0x0a, 0x8c, 0x1c}
retryNonceV1 = [12]byte{0x46, 0x15, 0x99, 0xd3, 0x5d, 0x63, 0x2b, 0xf2, 0x23, 0x98, 0x25, 0xbb}
retryNonceV2 = [12]byte{0xd8, 0x69, 0x69, 0xbc, 0x2d, 0x7c, 0x6d, 0x99, 0x90, 0xef, 0xb0, 0x4a}
retryBuf bytes.Buffer
retryMutex sync.Mutex
retryNonceV1 = [12]byte{0x46, 0x15, 0x99, 0xd3, 0x5d, 0x63, 0x2b, 0xf2, 0x23, 0x98, 0x25, 0xbb}
retryNonceV2 = [12]byte{0xd8, 0x69, 0x69, 0xbc, 0x2d, 0x7c, 0x6d, 0x99, 0x90, 0xef, 0xb0, 0x4a}
)

// GetRetryIntegrityTag calculates the integrity tag on a Retry packet
Expand All @@ -54,14 +51,10 @@ func GetRetryIntegrityTag(retry []byte, origDestConnID protocol.ConnectionID, ve

var tag [16]byte
var sealed []byte
//nolint:exhaustive // These are all the versions we support
switch version {
case protocol.Version1:
sealed = retryAEADv1.Seal(tag[:0], retryNonceV1[:], nil, retryBuf.Bytes())
case protocol.Version2:
if version == protocol.Version2 {
sealed = retryAEADv2.Seal(tag[:0], retryNonceV2[:], nil, retryBuf.Bytes())
default:
sealed = retryAEADdraft29.Seal(tag[:0], retryNonceDraft29[:], nil, retryBuf.Bytes())
} else {
sealed = retryAEADv1.Seal(tag[:0], retryNonceV1[:], nil, retryBuf.Bytes())
}
if len(sealed) != 16 {
panic(fmt.Sprintf("unexpected Retry integrity tag length: %d", len(sealed)))
Expand Down
8 changes: 2 additions & 6 deletions internal/handshake/retry_test.go
Expand Up @@ -12,8 +12,8 @@ import (
var _ = Describe("Retry Integrity Check", func() {
It("calculates retry integrity tags", func() {
connID := protocol.ParseConnectionID([]byte{1, 2, 3, 4})
fooTag := GetRetryIntegrityTag([]byte("foo"), connID, protocol.VersionDraft29)
barTag := GetRetryIntegrityTag([]byte("bar"), connID, protocol.VersionDraft29)
fooTag := GetRetryIntegrityTag([]byte("foo"), connID, protocol.Version1)
barTag := GetRetryIntegrityTag([]byte("bar"), connID, protocol.Version1)
Expect(fooTag).ToNot(BeNil())
Expect(barTag).ToNot(BeNil())
Expect(*fooTag).ToNot(Equal(*barTag))
Expand All @@ -34,10 +34,6 @@ var _ = Describe("Retry Integrity Check", func() {
connID := protocol.ParseConnectionID(splitHexString("0x8394c8f03e515708"))
Expect(GetRetryIntegrityTag(data[:len(data)-16], connID, version)[:]).To(Equal(data[len(data)-16:]))
},
Entry("draft-29",
protocol.VersionDraft29,
splitHexString("ffff00001d0008f067a5502a4262b574 6f6b656ed16926d81f6f9ca2953a8aa4 575e1e49"),
),
Entry("v1",
protocol.Version1,
splitHexString("ff000000010008f067a5502a4262b574 6f6b656e04a265ba2eff4d829058fb3f 0f2496ba"),
Expand Down
13 changes: 3 additions & 10 deletions internal/handshake/tls_extension_handler.go
Expand Up @@ -5,10 +5,7 @@ import (
"github.com/quic-go/quic-go/internal/qtls"
)

const (
quicTLSExtensionTypeOldDrafts = 0xffa5
quicTLSExtensionType = 0x39
)
const quicTLSExtensionType = 0x39

type extensionHandler struct {
ourParams []byte
Expand All @@ -22,16 +19,12 @@ type extensionHandler struct {
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.VersionDraft29 {
et = quicTLSExtensionTypeOldDrafts
}
func newExtensionHandler(params []byte, pers protocol.Perspective) tlsExtensionHandler {
return &extensionHandler{
ourParams: params,
paramsChan: make(chan []byte),
perspective: pers,
extensionType: et,
extensionType: quicTLSExtensionType,
}
}

Expand Down

0 comments on commit 21388c8

Please sign in to comment.