Add methods to QuicCryptoClientStreamBase to replace num_sent_client_hellos
The use of num_sent_client_hellos is to determine whether a 0-RTT handshake
was done (in which case it is 1) and whether an inchoate REJ was received
in the handshake (in which case it is 3). However, those only work for QUIC
crypto. To make the intention of its use clear and to make it easier to
replace QUIC crypto with TLS, the num_sent_client_hellos method is replaced
with EarlyDataAccepted and ReceivedInchoateReject.
gfe-relnote: no behavior change: adding unused methods
PiperOrigin-RevId: 294307567
Change-Id: I270cab9f702c66dbec6519a68965703a7872b87f
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc
index 42955ce..ece7a05 100644
--- a/quic/core/tls_client_handshaker.cc
+++ b/quic/core/tls_client_handshaker.cc
@@ -204,7 +204,6 @@
}
int TlsClientHandshaker::num_sent_client_hellos() const {
- // TODO(nharper): Return a sensible value here.
return 0;
}
@@ -213,6 +212,17 @@
return SSL_session_reused(ssl()) == 1;
}
+bool TlsClientHandshaker::EarlyDataAccepted() const {
+ QUIC_BUG_IF(!one_rtt_keys_available_);
+ return SSL_early_data_accepted(ssl()) == 1;
+}
+
+bool TlsClientHandshaker::ReceivedInchoateReject() const {
+ QUIC_BUG_IF(!one_rtt_keys_available_);
+ // REJ messages are a QUIC crypto feature, so TLS always returns false.
+ return false;
+}
+
int TlsClientHandshaker::num_scup_messages_received() const {
// SCUP messages aren't sent or received when using the TLS handshake.
return 0;