diff --git a/client_test.go b/client_test.go index ec8b83b8..71e16f0b 100644 --- a/client_test.go +++ b/client_test.go @@ -213,7 +213,6 @@ var _ = Describe("Client", func() { Context("quic.Config", func() { It("setups with the right values", func() { - srk := &StatelessResetKey{'f', 'o', 'o', 'b', 'a', 'r'} tokenStore := NewLRUTokenStore(10, 4) config := &Config{ HandshakeIdleTimeout: 1337 * time.Minute, @@ -221,7 +220,6 @@ var _ = Describe("Client", func() { MaxIncomingStreams: 1234, MaxIncomingUniStreams: 4321, ConnectionIDLength: 13, - StatelessResetKey: srk, TokenStore: tokenStore, EnableDatagrams: true, } @@ -231,7 +229,6 @@ var _ = Describe("Client", func() { Expect(c.MaxIncomingStreams).To(BeEquivalentTo(1234)) Expect(c.MaxIncomingUniStreams).To(BeEquivalentTo(4321)) Expect(c.ConnectionIDLength).To(Equal(13)) - Expect(c.StatelessResetKey).To(Equal(srk)) Expect(c.TokenStore).To(Equal(tokenStore)) Expect(c.EnableDatagrams).To(BeTrue()) }) diff --git a/config.go b/config.go index b513a46b..7a48b407 100644 --- a/config.go +++ b/config.go @@ -137,7 +137,6 @@ func populateConfig(config *Config, defaultConnIDLen int) *Config { MaxIncomingUniStreams: maxIncomingUniStreams, ConnectionIDLength: conIDLen, ConnectionIDGenerator: connIDGenerator, - StatelessResetKey: config.StatelessResetKey, TokenStore: config.TokenStore, EnableDatagrams: config.EnableDatagrams, DisablePathMTUDiscovery: config.DisablePathMTUDiscovery, diff --git a/integrationtests/self/stateless_reset_test.go b/integrationtests/self/stateless_reset_test.go index cc5afe90..3c9a1703 100644 --- a/integrationtests/self/stateless_reset_test.go +++ b/integrationtests/self/stateless_reset_test.go @@ -24,15 +24,15 @@ var _ = Describe("Stateless Resets", func() { It(fmt.Sprintf("sends and recognizes stateless resets, for %d byte connection IDs", connIDLen), func() { var statelessResetKey quic.StatelessResetKey rand.Read(statelessResetKey[:]) - serverConfig := getQuicConfig(&quic.Config{StatelessResetKey: &statelessResetKey}) c, err := net.ListenUDP("udp", nil) Expect(err).ToNot(HaveOccurred()) tr := &quic.Transport{ - Conn: c, + Conn: c, + StatelessResetKey: &statelessResetKey, } defer tr.Close() - ln, err := tr.Listen(getTLSConfig(), serverConfig) + ln, err := tr.Listen(getTLSConfig(), getQuicConfig(nil)) Expect(err).ToNot(HaveOccurred()) serverPort := ln.Addr().(*net.UDPAddr).Port @@ -90,7 +90,7 @@ var _ = Describe("Stateless Resets", func() { StatelessResetKey: &statelessResetKey, } defer tr2.Close() - ln2, err := tr2.Listen(getTLSConfig(), serverConfig) + ln2, err := tr2.Listen(getTLSConfig(), getQuicConfig(nil)) Expect(err).ToNot(HaveOccurred()) drop.Store(false) diff --git a/interface.go b/interface.go index 43101448..33309fac 100644 --- a/interface.go +++ b/interface.go @@ -314,9 +314,6 @@ type Config struct { // If not set, it will default to 100. // If set to a negative value, it doesn't allow any unidirectional streams. MaxIncomingUniStreams int64 - // The StatelessResetKey is used to generate stateless reset tokens. - // If no key is configured, sending of stateless resets is disabled. - StatelessResetKey *StatelessResetKey // KeepAlivePeriod defines whether this peer will periodically send a packet to keep the connection alive. // If set to 0, then no keep alive is sent. Otherwise, the keep alive is sent on that period (or at most // every half of MaxIdleTimeout, whichever is smaller). diff --git a/server_test.go b/server_test.go index 7f6e49a7..658bb45b 100644 --- a/server_test.go +++ b/server_test.go @@ -132,7 +132,6 @@ var _ = Describe("Server", func() { HandshakeIdleTimeout: 1337 * time.Hour, MaxIdleTimeout: 42 * time.Minute, KeepAlivePeriod: 5 * time.Second, - StatelessResetKey: &StatelessResetKey{'f', 'o', 'o', 'b', 'a', 'r'}, RequireAddressValidation: requireAddrVal, } ln, err := Listen(conn, tlsConf, &config) @@ -144,7 +143,6 @@ var _ = Describe("Server", func() { Expect(server.config.MaxIdleTimeout).To(Equal(42 * time.Minute)) Expect(reflect.ValueOf(server.config.RequireAddressValidation)).To(Equal(reflect.ValueOf(requireAddrVal))) Expect(server.config.KeepAlivePeriod).To(Equal(5 * time.Second)) - Expect(server.config.StatelessResetKey).To(Equal(&StatelessResetKey{'f', 'o', 'o', 'b', 'a', 'r'})) // stop the listener Expect(ln.Close()).To(Succeed()) }) diff --git a/transport.go b/transport.go index 2e860ee2..bf902fbc 100644 --- a/transport.go +++ b/transport.go @@ -207,7 +207,6 @@ func (t *Transport) init(conf *Config) error { return } - t.StatelessResetKey = conf.StatelessResetKey t.Tracer = conf.Tracer t.ConnectionIDLength = conf.ConnectionIDLength t.ConnectionIDGenerator = conf.ConnectionIDGenerator diff --git a/transport_test.go b/transport_test.go index 122dbba3..c404a3b9 100644 --- a/transport_test.go +++ b/transport_test.go @@ -251,9 +251,10 @@ var _ = Describe("Transport", func() { packetChan := make(chan packetToRead) conn := newMockPacketConn(packetChan) tr := Transport{ - Conn: conn, + Conn: conn, + StatelessResetKey: &StatelessResetKey{1, 2, 3, 4}, } - tr.init(&Config{ConnectionIDLength: connID.Len(), StatelessResetKey: &StatelessResetKey{1, 2, 3, 4}}) + tr.init(&Config{ConnectionIDLength: connID.Len()}) defer tr.Close() phm := NewMockPacketHandlerManager(mockCtrl) tr.init(&Config{})