gfe-relnote: In QUIC, rename handshake_confirmed in handshaker to one_rtt_keys_available to make it clearer and more informative. Renaming only, not protected.
Not rename it to handshake_complete, as in QUIC crypto server side, handshake complete is slightly different than one_rtt_keys_available.
PiperOrigin-RevId: 289682542
Change-Id: I87e1e4925f4916166afe2bac2a055a207de1025a
diff --git a/quic/core/http/quic_spdy_session_test.cc b/quic/core/http/quic_spdy_session_test.cc
index e0c7823..a2c77e7 100644
--- a/quic/core/http/quic_spdy_session_test.cc
+++ b/quic/core/http/quic_spdy_session_test.cc
@@ -73,7 +73,7 @@
: QuicCryptoStream(session),
QuicCryptoHandshaker(this, session),
encryption_established_(false),
- handshake_confirmed_(false),
+ one_rtt_keys_available_(false),
params_(new QuicCryptoNegotiatedParameters) {
// Simulate a negotiated cipher_suite with a fake value.
params_->cipher_suite = 1;
@@ -81,7 +81,7 @@
void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override {
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
QuicErrorCode error;
std::string error_details;
session()->config()->SetInitialStreamFlowControlWindowToSend(
@@ -117,7 +117,9 @@
bool encryption_established() const override {
return encryption_established_;
}
- bool handshake_confirmed() const override { return handshake_confirmed_; }
+ bool one_rtt_keys_available() const override {
+ return one_rtt_keys_available_;
+ }
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override {
return *params_;
@@ -137,7 +139,7 @@
using QuicCryptoStream::session;
bool encryption_established_;
- bool handshake_confirmed_;
+ bool one_rtt_keys_available_;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_;
};
diff --git a/quic/core/quic_crypto_client_handshaker.cc b/quic/core/quic_crypto_client_handshaker.cc
index ae48bdc..9b6b38d 100644
--- a/quic/core/quic_crypto_client_handshaker.cc
+++ b/quic/core/quic_crypto_client_handshaker.cc
@@ -69,7 +69,7 @@
proof_verify_start_time_(QuicTime::Zero()),
num_scup_messages_received_(0),
encryption_established_(false),
- handshake_confirmed_(false),
+ one_rtt_keys_available_(false),
crypto_negotiated_params_(new QuicCryptoNegotiatedParameters) {}
QuicCryptoClientHandshaker::~QuicCryptoClientHandshaker() {
@@ -82,7 +82,7 @@
const CryptoHandshakeMessage& message) {
QuicCryptoHandshaker::OnHandshakeMessage(message);
if (message.tag() == kSCUP) {
- if (!handshake_confirmed()) {
+ if (!one_rtt_keys_available()) {
stream_->CloseConnectionWithDetails(
QUIC_CRYPTO_UPDATE_BEFORE_HANDSHAKE_COMPLETE,
"Early SCUP disallowed");
@@ -97,7 +97,7 @@
}
// Do not process handshake messages after the handshake is confirmed.
- if (handshake_confirmed()) {
+ if (one_rtt_keys_available()) {
stream_->CloseConnectionWithDetails(
QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE,
"Unexpected handshake message");
@@ -118,7 +118,7 @@
}
bool QuicCryptoClientHandshaker::IsResumption() const {
- QUIC_BUG_IF(!handshake_confirmed_);
+ QUIC_BUG_IF(!one_rtt_keys_available_);
// While 0-RTT handshakes could be considered to be like resumption, QUIC
// Crypto doesn't have the same notion of a resumption like TLS does.
return false;
@@ -136,8 +136,8 @@
return encryption_established_;
}
-bool QuicCryptoClientHandshaker::handshake_confirmed() const {
- return handshake_confirmed_;
+bool QuicCryptoClientHandshaker::one_rtt_keys_available() const {
+ return one_rtt_keys_available_;
}
const QuicCryptoNegotiatedParameters&
@@ -171,7 +171,7 @@
return;
}
- DCHECK(handshake_confirmed());
+ DCHECK(one_rtt_keys_available());
if (proof_verify_callback_) {
proof_verify_callback_->Cancel();
}
@@ -473,7 +473,7 @@
}
next_state_ = STATE_NONE;
QUIC_CLIENT_HISTOGRAM_BOOL("QuicVerifyProofFailed.HandshakeConfirmed",
- handshake_confirmed(), "");
+ one_rtt_keys_available(), "");
stream_->CloseConnectionWithDetails(
QUIC_PROOF_INVALID, "Proof invalid: " + verify_error_details_);
return;
@@ -486,7 +486,7 @@
} else {
SetCachedProofValid(cached);
cached->SetProofVerifyDetails(verify_details_.release());
- if (!handshake_confirmed()) {
+ if (!one_rtt_keys_available()) {
next_state_ = STATE_SEND_CHLO;
} else {
// TODO: Enable Expect-Staple. https://crbug.com/631101
@@ -560,7 +560,7 @@
ENCRYPTION_FORWARD_SECURE, std::move(crypters->decrypter),
/*set_alternative_decrypter=*/true,
/*latch_once_used=*/false, std::move(crypters->encrypter));
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
delegate_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
delegate_->DiscardOldEncryptionKey(ENCRYPTION_INITIAL);
delegate_->NeuterHandshakeData();
@@ -579,7 +579,7 @@
std::move(crypters->encrypter));
session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED);
session()->connection()->OnHandshakeComplete();
}
diff --git a/quic/core/quic_crypto_client_handshaker.h b/quic/core/quic_crypto_client_handshaker.h
index e9e2f66..2c35796 100644
--- a/quic/core/quic_crypto_client_handshaker.h
+++ b/quic/core/quic_crypto_client_handshaker.h
@@ -41,7 +41,7 @@
int num_scup_messages_received() const override;
std::string chlo_hash() const override;
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
@@ -173,7 +173,7 @@
int num_scup_messages_received_;
bool encryption_established_;
- bool handshake_confirmed_;
+ bool one_rtt_keys_available_;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;
};
diff --git a/quic/core/quic_crypto_client_stream.cc b/quic/core/quic_crypto_client_stream.cc
index e940635..3286b66 100644
--- a/quic/core/quic_crypto_client_stream.cc
+++ b/quic/core/quic_crypto_client_stream.cc
@@ -73,8 +73,8 @@
return handshaker_->encryption_established();
}
-bool QuicCryptoClientStream::handshake_confirmed() const {
- return handshaker_->handshake_confirmed();
+bool QuicCryptoClientStream::one_rtt_keys_available() const {
+ return handshaker_->one_rtt_keys_available();
}
const QuicCryptoNegotiatedParameters&
diff --git a/quic/core/quic_crypto_client_stream.h b/quic/core/quic_crypto_client_stream.h
index cf1d3e9..eb4630b 100644
--- a/quic/core/quic_crypto_client_stream.h
+++ b/quic/core/quic_crypto_client_stream.h
@@ -104,8 +104,8 @@
// for the connection.
virtual bool encryption_established() const = 0;
- // Returns true once the crypto handshake has completed.
- virtual bool handshake_confirmed() const = 0;
+ // Returns true once 1RTT keys are available.
+ virtual bool one_rtt_keys_available() const = 0;
// Returns the parameters negotiated in the crypto handshake.
virtual const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
@@ -157,7 +157,7 @@
// From QuicCryptoStream
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
diff --git a/quic/core/quic_crypto_client_stream_test.cc b/quic/core/quic_crypto_client_stream_test.cc
index a2e40c4..0cfdbe9 100644
--- a/quic/core/quic_crypto_client_stream_test.cc
+++ b/quic/core/quic_crypto_client_stream_test.cc
@@ -104,13 +104,13 @@
TEST_F(QuicCryptoClientStreamTest, NotInitiallyConected) {
EXPECT_FALSE(stream()->encryption_established());
- EXPECT_FALSE(stream()->handshake_confirmed());
+ EXPECT_FALSE(stream()->one_rtt_keys_available());
}
TEST_F(QuicCryptoClientStreamTest, ConnectedAfterSHLO) {
CompleteCryptoHandshake();
EXPECT_TRUE(stream()->encryption_established());
- EXPECT_TRUE(stream()->handshake_confirmed());
+ EXPECT_TRUE(stream()->one_rtt_keys_available());
EXPECT_FALSE(stream()->IsResumption());
}
@@ -120,7 +120,7 @@
CompleteCryptoHandshake();
EXPECT_EQ(PROTOCOL_TLS1_3, stream()->handshake_protocol());
EXPECT_TRUE(stream()->encryption_established());
- EXPECT_TRUE(stream()->handshake_confirmed());
+ EXPECT_TRUE(stream()->one_rtt_keys_available());
EXPECT_FALSE(stream()->IsResumption());
}
@@ -137,7 +137,7 @@
connection_, stream(), AlpnForVersion(connection_->version()));
EXPECT_EQ(PROTOCOL_TLS1_3, stream()->handshake_protocol());
EXPECT_TRUE(stream()->encryption_established());
- EXPECT_TRUE(stream()->handshake_confirmed());
+ EXPECT_TRUE(stream()->one_rtt_keys_available());
}
TEST_F(QuicCryptoClientStreamTest, TlsResumption) {
@@ -151,7 +151,7 @@
EXPECT_EQ(PROTOCOL_TLS1_3, stream()->handshake_protocol());
EXPECT_TRUE(stream()->encryption_established());
- EXPECT_TRUE(stream()->handshake_confirmed());
+ EXPECT_TRUE(stream()->one_rtt_keys_available());
EXPECT_FALSE(stream()->IsResumption());
// Create a second connection
@@ -160,7 +160,7 @@
EXPECT_EQ(PROTOCOL_TLS1_3, stream()->handshake_protocol());
EXPECT_TRUE(stream()->encryption_established());
- EXPECT_TRUE(stream()->handshake_confirmed());
+ EXPECT_TRUE(stream()->one_rtt_keys_available());
EXPECT_TRUE(stream()->IsResumption());
}
diff --git a/quic/core/quic_crypto_server_handshaker.cc b/quic/core/quic_crypto_server_handshaker.cc
index 94293f4..5adbe78 100644
--- a/quic/core/quic_crypto_server_handshaker.cc
+++ b/quic/core/quic_crypto_server_handshaker.cc
@@ -69,7 +69,7 @@
validate_client_hello_cb_(nullptr),
process_client_hello_cb_(nullptr),
encryption_established_(false),
- handshake_confirmed_(false),
+ one_rtt_keys_available_(false),
crypto_negotiated_params_(new QuicCryptoNegotiatedParameters) {}
QuicCryptoServerHandshaker::~QuicCryptoServerHandshaker() {
@@ -99,7 +99,7 @@
chlo_packet_size_ = session()->connection()->GetCurrentPacket().length();
// Do not process handshake messages after the handshake is confirmed.
- if (handshake_confirmed_) {
+ if (one_rtt_keys_available_) {
stream_->CloseConnectionWithDetails(
QUIC_CRYPTO_MESSAGE_AFTER_HANDSHAKE_COMPLETE,
"Unexpected handshake message from client");
@@ -240,7 +240,7 @@
std::move(
crypto_negotiated_params_->forward_secure_crypters.encrypter));
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
delegate_->SetDefaultEncryptionLevel(ENCRYPTION_FORWARD_SECURE);
delegate_->DiscardOldEncryptionKey(ENCRYPTION_INITIAL);
return;
@@ -264,13 +264,13 @@
}
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
session()->OnCryptoHandshakeEvent(QuicSession::HANDSHAKE_CONFIRMED);
}
void QuicCryptoServerHandshaker::SendServerConfigUpdate(
const CachedNetworkParameters* cached_network_params) {
- if (!handshake_confirmed_) {
+ if (!one_rtt_keys_available_) {
return;
}
@@ -394,8 +394,8 @@
return encryption_established_;
}
-bool QuicCryptoServerHandshaker::handshake_confirmed() const {
- return handshake_confirmed_;
+bool QuicCryptoServerHandshaker::one_rtt_keys_available() const {
+ return one_rtt_keys_available_;
}
const QuicCryptoNegotiatedParameters&
diff --git a/quic/core/quic_crypto_server_handshaker.h b/quic/core/quic_crypto_server_handshaker.h
index a2ed38a..f873c93 100644
--- a/quic/core/quic_crypto_server_handshaker.h
+++ b/quic/core/quic_crypto_server_handshaker.h
@@ -55,7 +55,7 @@
// From QuicCryptoStream
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
@@ -85,8 +85,8 @@
encryption_established_ = encryption_established;
}
- void set_handshake_confirmed(bool handshake_confirmed) {
- handshake_confirmed_ = handshake_confirmed;
+ void set_one_rtt_keys_available(bool one_rtt_keys_available) {
+ one_rtt_keys_available_ = one_rtt_keys_available;
}
private:
@@ -227,7 +227,7 @@
ProcessClientHelloCallback* process_client_hello_cb_;
bool encryption_established_;
- bool handshake_confirmed_;
+ bool one_rtt_keys_available_;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;
};
diff --git a/quic/core/quic_crypto_server_stream.cc b/quic/core/quic_crypto_server_stream.cc
index 8a299c5..19a2b34 100644
--- a/quic/core/quic_crypto_server_stream.cc
+++ b/quic/core/quic_crypto_server_stream.cc
@@ -134,11 +134,11 @@
return handshaker_->encryption_established();
}
-bool QuicCryptoServerStream::handshake_confirmed() const {
+bool QuicCryptoServerStream::one_rtt_keys_available() const {
if (!handshaker_) {
return false;
}
- return handshaker_->handshake_confirmed();
+ return handshaker_->one_rtt_keys_available();
}
const QuicCryptoNegotiatedParameters&
diff --git a/quic/core/quic_crypto_server_stream.h b/quic/core/quic_crypto_server_stream.h
index 748fd1e..09ccacb 100644
--- a/quic/core/quic_crypto_server_stream.h
+++ b/quic/core/quic_crypto_server_stream.h
@@ -118,8 +118,8 @@
// for the connection.
virtual bool encryption_established() const = 0;
- // Returns true once the crypto handshake has completed.
- virtual bool handshake_confirmed() const = 0;
+ // Returns true once 1RTT keys are available.
+ virtual bool one_rtt_keys_available() const = 0;
// Returns the parameters negotiated in the crypto handshake.
virtual const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
@@ -167,7 +167,7 @@
bool ShouldSendExpectCTHeader() const override;
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
diff --git a/quic/core/quic_crypto_server_stream_test.cc b/quic/core/quic_crypto_server_stream_test.cc
index 78f2f52..9b13173 100644
--- a/quic/core/quic_crypto_server_stream_test.cc
+++ b/quic/core/quic_crypto_server_stream_test.cc
@@ -190,7 +190,7 @@
TEST_P(QuicCryptoServerStreamTest, NotInitiallyConected) {
Initialize();
EXPECT_FALSE(server_stream()->encryption_established());
- EXPECT_FALSE(server_stream()->handshake_confirmed());
+ EXPECT_FALSE(server_stream()->one_rtt_keys_available());
}
TEST_P(QuicCryptoServerStreamTest, ConnectedAfterCHLO) {
@@ -201,7 +201,7 @@
Initialize();
EXPECT_EQ(2, CompleteCryptoHandshake());
EXPECT_TRUE(server_stream()->encryption_established());
- EXPECT_TRUE(server_stream()->handshake_confirmed());
+ EXPECT_TRUE(server_stream()->one_rtt_keys_available());
}
TEST_P(QuicCryptoServerStreamTest, ConnectedAfterTlsHandshake) {
@@ -217,7 +217,7 @@
CompleteCryptoHandshake();
EXPECT_EQ(PROTOCOL_TLS1_3, server_stream()->handshake_protocol());
EXPECT_TRUE(server_stream()->encryption_established());
- EXPECT_TRUE(server_stream()->handshake_confirmed());
+ EXPECT_TRUE(server_stream()->one_rtt_keys_available());
}
TEST_P(QuicCryptoServerStreamTest, ForwardSecureAfterCHLO) {
@@ -228,7 +228,7 @@
// information.
AdvanceHandshakeWithFakeClient();
EXPECT_FALSE(server_stream()->encryption_established());
- EXPECT_FALSE(server_stream()->handshake_confirmed());
+ EXPECT_FALSE(server_stream()->one_rtt_keys_available());
// Now do another handshake, with the blocking SHLO connection option.
InitializeServer();
@@ -236,7 +236,7 @@
AdvanceHandshakeWithFakeClient();
EXPECT_TRUE(server_stream()->encryption_established());
- EXPECT_TRUE(server_stream()->handshake_confirmed());
+ EXPECT_TRUE(server_stream()->one_rtt_keys_available());
EXPECT_EQ(ENCRYPTION_FORWARD_SECURE,
server_session_->connection()->encryption_level());
}
@@ -361,7 +361,7 @@
// Regression test for b/31521252, in which a crash would happen here.
AdvanceHandshakeWithFakeClient();
EXPECT_FALSE(server_stream()->encryption_established());
- EXPECT_FALSE(server_stream()->handshake_confirmed());
+ EXPECT_FALSE(server_stream()->one_rtt_keys_available());
}
class QuicCryptoServerStreamTestWithFakeProofSource
diff --git a/quic/core/quic_crypto_stream.cc b/quic/core/quic_crypto_stream.cc
index 62605d4..6f92f3f 100644
--- a/quic/core/quic_crypto_stream.cc
+++ b/quic/core/quic_crypto_stream.cc
@@ -115,7 +115,7 @@
return;
}
sequencer->MarkConsumed(iov.iov_len);
- if (handshake_confirmed() &&
+ if (one_rtt_keys_available() &&
crypto_message_parser()->InputBytesRemaining() == 0) {
// If the handshake is complete and the current message has been fully
// processed then no more handshake messages are likely to arrive soon
@@ -129,7 +129,7 @@
quiche::QuicheStringPiece context,
size_t result_len,
std::string* result) const {
- if (!handshake_confirmed()) {
+ if (!one_rtt_keys_available()) {
QUIC_DLOG(ERROR) << "ExportKeyingMaterial was called before forward-secure"
<< "encryption was established.";
return false;
diff --git a/quic/core/quic_crypto_stream.h b/quic/core/quic_crypto_stream.h
index ccaa6a7..15f5a3d 100644
--- a/quic/core/quic_crypto_stream.h
+++ b/quic/core/quic_crypto_stream.h
@@ -73,7 +73,7 @@
virtual bool encryption_established() const = 0;
// Returns true once the crypto handshake has completed.
- virtual bool handshake_confirmed() const = 0;
+ virtual bool one_rtt_keys_available() const = 0;
// Returns the parameters negotiated in the crypto handshake.
virtual const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
diff --git a/quic/core/quic_crypto_stream_test.cc b/quic/core/quic_crypto_stream_test.cc
index 25d9cc1..62b5633 100644
--- a/quic/core/quic_crypto_stream_test.cc
+++ b/quic/core/quic_crypto_stream_test.cc
@@ -47,7 +47,7 @@
std::vector<CryptoHandshakeMessage>* messages() { return &messages_; }
bool encryption_established() const override { return false; }
- bool handshake_confirmed() const override { return false; }
+ bool one_rtt_keys_available() const override { return false; }
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override {
@@ -98,7 +98,7 @@
TEST_F(QuicCryptoStreamTest, NotInitiallyConected) {
EXPECT_FALSE(stream_->encryption_established());
- EXPECT_FALSE(stream_->handshake_confirmed());
+ EXPECT_FALSE(stream_->one_rtt_keys_available());
}
TEST_F(QuicCryptoStreamTest, ProcessRawData) {
diff --git a/quic/core/quic_session.cc b/quic/core/quic_session.cc
index 2167613..11a3268 100644
--- a/quic/core/quic_session.cc
+++ b/quic/core/quic_session.cc
@@ -989,7 +989,7 @@
if (GetCryptoStream() == nullptr) {
return false;
}
- return GetCryptoStream()->handshake_confirmed();
+ return GetCryptoStream()->one_rtt_keys_available();
}
void QuicSession::OnConfigNegotiated() {
diff --git a/quic/core/quic_session_test.cc b/quic/core/quic_session_test.cc
index f4323f9..01b180d 100644
--- a/quic/core/quic_session_test.cc
+++ b/quic/core/quic_session_test.cc
@@ -60,7 +60,7 @@
: QuicCryptoStream(session),
QuicCryptoHandshaker(this, session),
encryption_established_(false),
- handshake_confirmed_(false),
+ one_rtt_keys_available_(false),
params_(new QuicCryptoNegotiatedParameters) {
// Simulate a negotiated cipher_suite with a fake value.
params_->cipher_suite = 1;
@@ -68,7 +68,7 @@
void OnHandshakeMessage(const CryptoHandshakeMessage& /*message*/) override {
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
QuicErrorCode error;
std::string error_details;
session()->config()->SetInitialStreamFlowControlWindowToSend(
@@ -104,7 +104,9 @@
bool encryption_established() const override {
return encryption_established_;
}
- bool handshake_confirmed() const override { return handshake_confirmed_; }
+ bool one_rtt_keys_available() const override {
+ return one_rtt_keys_available_;
+ }
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override {
return *params_;
@@ -123,7 +125,7 @@
using QuicCryptoStream::session;
bool encryption_established_;
- bool handshake_confirmed_;
+ bool one_rtt_keys_available_;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters> params_;
};
diff --git a/quic/core/tls_client_handshaker.cc b/quic/core/tls_client_handshaker.cc
index 5d9ffd4..d3cd24f 100644
--- a/quic/core/tls_client_handshaker.cc
+++ b/quic/core/tls_client_handshaker.cc
@@ -208,7 +208,7 @@
}
bool TlsClientHandshaker::IsResumption() const {
- QUIC_BUG_IF(!handshake_confirmed_);
+ QUIC_BUG_IF(!one_rtt_keys_available_);
return SSL_session_reused(ssl()) == 1;
}
@@ -225,8 +225,8 @@
return encryption_established_;
}
-bool TlsClientHandshaker::handshake_confirmed() const {
- return handshake_confirmed_;
+bool TlsClientHandshaker::one_rtt_keys_available() const {
+ return one_rtt_keys_available_;
}
const QuicCryptoNegotiatedParameters&
@@ -336,7 +336,7 @@
<< "'";
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
// Fill crypto_negotiated_params_:
const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl());
diff --git a/quic/core/tls_client_handshaker.h b/quic/core/tls_client_handshaker.h
index 83a1975..14ef352 100644
--- a/quic/core/tls_client_handshaker.h
+++ b/quic/core/tls_client_handshaker.h
@@ -45,7 +45,7 @@
// From QuicCryptoClientStream::HandshakerInterface and TlsHandshaker
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
@@ -133,7 +133,7 @@
std::string cert_verify_error_details_;
bool encryption_established_ = false;
- bool handshake_confirmed_ = false;
+ bool one_rtt_keys_available_ = false;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;
diff --git a/quic/core/tls_handshaker.h b/quic/core/tls_handshaker.h
index 8fb5e38..d0d9bf8 100644
--- a/quic/core/tls_handshaker.h
+++ b/quic/core/tls_handshaker.h
@@ -48,7 +48,7 @@
// From QuicCryptoStream
virtual bool encryption_established() const = 0;
- virtual bool handshake_confirmed() const = 0;
+ virtual bool one_rtt_keys_available() const = 0;
virtual const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const = 0;
virtual CryptoMessageParser* crypto_message_parser() { return this; }
diff --git a/quic/core/tls_handshaker_test.cc b/quic/core/tls_handshaker_test.cc
index a6aa29a..9935839 100644
--- a/quic/core/tls_handshaker_test.cc
+++ b/quic/core/tls_handshaker_test.cc
@@ -162,8 +162,8 @@
return handshaker()->encryption_established();
}
- bool handshake_confirmed() const override {
- return handshaker()->handshake_confirmed();
+ bool one_rtt_keys_available() const override {
+ return handshaker()->one_rtt_keys_available();
}
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
@@ -327,9 +327,9 @@
client_session_.Initialize();
server_session_.Initialize();
EXPECT_FALSE(client_stream_->encryption_established());
- EXPECT_FALSE(client_stream_->handshake_confirmed());
+ EXPECT_FALSE(client_stream_->one_rtt_keys_available());
EXPECT_FALSE(server_stream_->encryption_established());
- EXPECT_FALSE(server_stream_->handshake_confirmed());
+ EXPECT_FALSE(server_stream_->one_rtt_keys_available());
const std::string default_alpn =
AlpnForVersion(client_session_.connection()->version());
ON_CALL(client_session_, GetAlpnsToOffer())
@@ -343,9 +343,9 @@
}
void ExpectHandshakeSuccessful() {
- EXPECT_TRUE(client_stream_->handshake_confirmed());
+ EXPECT_TRUE(client_stream_->one_rtt_keys_available());
EXPECT_TRUE(client_stream_->encryption_established());
- EXPECT_TRUE(server_stream_->handshake_confirmed());
+ EXPECT_TRUE(server_stream_->one_rtt_keys_available());
EXPECT_TRUE(server_stream_->encryption_established());
EXPECT_TRUE(client_conn_->IsHandshakeComplete());
EXPECT_TRUE(server_conn_->IsHandshakeComplete());
@@ -500,7 +500,7 @@
QUICHE_ARRAYSIZE(bogus_handshake_message)));
server_stream_->SendCryptoMessagesToPeer(client_stream_);
- EXPECT_FALSE(client_stream_->handshake_confirmed());
+ EXPECT_FALSE(client_stream_->one_rtt_keys_available());
}
TEST_F(TlsHandshakerTest, ServerConnectionClosedOnTlsError) {
@@ -518,7 +518,7 @@
QUICHE_ARRAYSIZE(bogus_handshake_message)));
client_stream_->SendCryptoMessagesToPeer(server_stream_);
- EXPECT_FALSE(server_stream_->handshake_confirmed());
+ EXPECT_FALSE(server_stream_->one_rtt_keys_available());
}
TEST_F(TlsHandshakerTest, ClientNotSendingALPN) {
@@ -533,9 +533,9 @@
client_stream_->CryptoConnect();
ExchangeHandshakeMessages(client_stream_, server_stream_);
- EXPECT_FALSE(client_stream_->handshake_confirmed());
+ EXPECT_FALSE(client_stream_->one_rtt_keys_available());
EXPECT_FALSE(client_stream_->encryption_established());
- EXPECT_FALSE(server_stream_->handshake_confirmed());
+ EXPECT_FALSE(server_stream_->one_rtt_keys_available());
EXPECT_FALSE(server_stream_->encryption_established());
}
@@ -551,9 +551,9 @@
client_stream_->CryptoConnect();
ExchangeHandshakeMessages(client_stream_, server_stream_);
- EXPECT_FALSE(client_stream_->handshake_confirmed());
+ EXPECT_FALSE(client_stream_->one_rtt_keys_available());
EXPECT_FALSE(client_stream_->encryption_established());
- EXPECT_FALSE(server_stream_->handshake_confirmed());
+ EXPECT_FALSE(server_stream_->one_rtt_keys_available());
EXPECT_FALSE(server_stream_->encryption_established());
}
@@ -588,9 +588,9 @@
client_stream_->CryptoConnect();
ExchangeHandshakeMessages(client_stream_, server_stream_);
- EXPECT_FALSE(client_stream_->handshake_confirmed());
+ EXPECT_FALSE(client_stream_->one_rtt_keys_available());
EXPECT_FALSE(client_stream_->encryption_established());
- EXPECT_FALSE(server_stream_->handshake_confirmed());
+ EXPECT_FALSE(server_stream_->one_rtt_keys_available());
EXPECT_FALSE(server_stream_->encryption_established());
}
diff --git a/quic/core/tls_server_handshaker.cc b/quic/core/tls_server_handshaker.cc
index 87c146f..500cecf 100644
--- a/quic/core/tls_server_handshaker.cc
+++ b/quic/core/tls_server_handshaker.cc
@@ -128,8 +128,8 @@
return encryption_established_;
}
-bool TlsServerHandshaker::handshake_confirmed() const {
- return handshake_confirmed_;
+bool TlsServerHandshaker::one_rtt_keys_available() const {
+ return one_rtt_keys_available_;
}
const QuicCryptoNegotiatedParameters&
@@ -264,7 +264,7 @@
state_ = STATE_HANDSHAKE_COMPLETE;
encryption_established_ = true;
- handshake_confirmed_ = true;
+ one_rtt_keys_available_ = true;
// Fill crypto_negotiated_params_:
const SSL_CIPHER* cipher = SSL_get_current_cipher(ssl());
diff --git a/quic/core/tls_server_handshaker.h b/quic/core/tls_server_handshaker.h
index 6def370..4bf5d22 100644
--- a/quic/core/tls_server_handshaker.h
+++ b/quic/core/tls_server_handshaker.h
@@ -52,7 +52,7 @@
// From QuicCryptoServerStream::HandshakerInterface and TlsHandshaker
bool encryption_established() const override;
- bool handshake_confirmed() const override;
+ bool one_rtt_keys_available() const override;
const QuicCryptoNegotiatedParameters& crypto_negotiated_params()
const override;
CryptoMessageParser* crypto_message_parser() override;
@@ -126,7 +126,7 @@
std::string cert_verify_sig_;
bool encryption_established_ = false;
- bool handshake_confirmed_ = false;
+ bool one_rtt_keys_available_ = false;
bool valid_alpn_received_ = false;
QuicReferenceCountedPointer<QuicCryptoNegotiatedParameters>
crypto_negotiated_params_;