@@ -709,26 +709,6 @@ void QuicSession::RandomConnectionIDStrategy(
709709 EntropySource (cid->data , cidlen);
710710}
711711
712- // Generates a stateless reset token as a function of the reset
713- // secret (generated randomly by default or set by config option)
714- // and the provided cid. The stateless reset is generated
715- // cryptographically and can be recreated later without storing
716- // additional state.
717- void QuicSession::CryptoStatelessResetTokenStrategy (
718- QuicSession* session,
719- const QuicCID& cid,
720- uint8_t * token,
721- size_t tokenlen) {
722- // For the current time, we limit stateless reset token lengths to
723- // NGTCP2_STATELESS_RESET_TOKENLEN. The tokenlen argument is largely
724- // for future proofing in case that restriction changes.
725- CHECK_EQ (tokenlen, NGTCP2_STATELESS_RESET_TOKENLEN);
726- CHECK (GenerateResetToken (
727- token,
728- session->socket ()->session_reset_secret (),
729- cid));
730- }
731-
732712// Check required capabilities were not excluded from the OpenSSL build:
733713// - OPENSSL_NO_SSL_TRACE excludes SSL_trace()
734714// - OPENSSL_NO_STDIO excludes BIO_new_fp()
@@ -1352,7 +1332,6 @@ QuicSession::QuicSession(
13521332 state_(env()->isolate(), IDX_QUIC_SESSION_STATE_COUNT) {
13531333 PushListener (&default_listener_);
13541334 set_connection_id_strategy (RandomConnectionIDStrategy);
1355- set_stateless_reset_token_strategy (CryptoStatelessResetTokenStrategy);
13561335 set_preferred_address_strategy (preferred_address_strategy);
13571336 crypto_context_.reset (new QuicCryptoContext (this , ctx, side, options));
13581337 application_.reset (SelectApplication (this ));
@@ -1630,7 +1609,7 @@ int QuicSession::GetNewConnectionID(
16301609 CHECK_NOT_NULL (connection_id_strategy_);
16311610 connection_id_strategy_ (this , cid, cidlen);
16321611 QuicCID cid_ (cid);
1633- stateless_reset_strategy_ ( this , cid_, token, NGTCP2_STATELESS_RESET_TOKENLEN );
1612+ StatelessResetToken (token, socket ()-> session_reset_secret (), cid_ );
16341613 AssociateCID (cid_);
16351614 return 0 ;
16361615}
@@ -2629,16 +2608,8 @@ void QuicSession::InitServer(
26292608
26302609 connection_id_strategy_ (this , scid_.cid (), kScidLen );
26312610
2632- config.GenerateStatelessResetToken (
2633- stateless_reset_strategy_,
2634- this ,
2635- scid_);
2636-
2637- config.GeneratePreferredAddressToken (
2638- connection_id_strategy_,
2639- stateless_reset_strategy_,
2640- this ,
2641- &pscid_);
2611+ config.GenerateStatelessResetToken (this , scid_);
2612+ config.GeneratePreferredAddressToken (connection_id_strategy_, this , &pscid_);
26422613
26432614 QuicPath path (local_addr, remote_address_);
26442615
0 commit comments