Send correct stateless reset token when using TLS
When using TLS, the stateless reset token needs to be populated in the QuicConfig early in the session's lifetime to ensure it's correctly encoded in the server's transport parameters. Previously the server would send an all-zeroes token. I've confirmed that EndToEndTestWithTls.SendStatelessResetTokenInShlo fails without the fix and passes with the fix.
gfe-relnote: send correct reset token, protected by disabled TLS flag
PiperOrigin-RevId: 261374750
Change-Id: I60725c5eb6cedfa1b06cf3797bf258875fb495eb
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 1dbaf44..ba53d5e 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -93,6 +93,10 @@
closed_streams_clean_up_alarm_ =
QuicWrapUnique<QuicAlarm>(connection_->alarm_factory()->CreateAlarm(
new ClosedStreamsCleanUpDelegate(this)));
+ if (perspective() == Perspective::IS_SERVER &&
+ connection_->version().handshake_protocol == PROTOCOL_TLS1_3) {
+ config_.SetStatelessResetTokenToSend(GetStatelessResetToken());
+ }
}
void QuicSession::Initialize() {