Add support for accepting 0-RTT in TlsServerHandshaker
This adds support at the crypto handshake layer for supporting 0-RTT TLS
handshakes on the server. Part of this support includes receiving a signal
from the application layer, via a new method
QuicCryptoStream::SetServerApplicationStateForResumption. This method
replaces the previously client-only
QuicCryptoClientStream::OnApplicationState.
Introduce quic 0-rtt tls support, protected by quic_enable_zero_rtt_for_tls
PiperOrigin-RevId: 315331343
Change-Id: Ife83cf526be38bd4f5c8a3de0e6cd4c40be6f7ae
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc
index 864040c..cf754ec 100644
--- a/quic/core/tls_client_handshaker.cc
+++ b/quic/core/tls_client_handshaker.cc
@@ -149,7 +149,7 @@
session()->OnConfigNegotiated();
if (has_application_state_) {
- if (!session()->SetApplicationState(cached_state->application_state)) {
+ if (!session()->ResumeApplicationState(cached_state->application_state)) {
QUIC_BUG << "Unable to parse cached application state.";
CloseConnection(QUIC_HANDSHAKE_FAILED,
"Client failed to parse cached application state.");
@@ -617,7 +617,7 @@
TlsHandshaker::WriteMessage(level, data);
}
-void TlsClientHandshaker::OnApplicationState(
+void TlsClientHandshaker::SetServerApplicationStateForResumption(
std::unique_ptr<ApplicationState> application_state) {
DCHECK_EQ(STATE_HANDSHAKE_COMPLETE, state_);
received_application_state_ = std::move(application_state);