Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(429)

Unified Diff: net/quic/quic_crypto_client_stream.cc

Issue 18033005: Cleanup of OpenSSL/NSS implementation of ProofVerfifier release. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implemented wtc's comments Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/quic_crypto_client_stream.h ('k') | net/quic/quic_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_crypto_client_stream.cc
diff --git a/net/quic/quic_crypto_client_stream.cc b/net/quic/quic_crypto_client_stream.cc
index f0ec9130f3cd926de064c3a545a840b80ad208d1..7b6eb7ab1e35373f423229e5f0cc54ed39b28059 100644
--- a/net/quic/quic_crypto_client_stream.cc
+++ b/net/quic/quic_crypto_client_stream.cc
@@ -71,7 +71,8 @@ void QuicCryptoClientStream::DoHandshakeLoop(
next_state_ = STATE_IDLE;
switch (state) {
case STATE_SEND_CHLO: {
- // Send the subsequent client hello in plaintext.
+ DCHECK_EQ(OK, result);
+ // Send the client hello in plaintext.
session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_NONE);
if (num_client_hellos_ > kMaxClientHellos) {
CloseConnection(QUIC_CRYPTO_TOO_MANY_REJECTS);
@@ -153,7 +154,7 @@ void QuicCryptoClientStream::DoHandshakeLoop(
cached->SetProofValid();
} else if (!cached->signature().empty()) {
next_state_ = STATE_VERIFY_PROOF;
- continue;
+ break;
}
}
next_state_ = STATE_SEND_CHLO;
@@ -161,7 +162,7 @@ void QuicCryptoClientStream::DoHandshakeLoop(
case STATE_VERIFY_PROOF: {
ProofVerifier* verifier = session()->proof_verifier();
DCHECK(verifier);
- next_state_ = STATE_VERIFY_PROOF_COMPLETED;
+ next_state_ = STATE_VERIFY_PROOF_COMPLETE;
generation_counter_ = cached->generation_counter();
result = verifier->VerifyProof(
server_hostname_,
@@ -177,24 +178,21 @@ void QuicCryptoClientStream::DoHandshakeLoop(
}
break;
}
- case STATE_VERIFY_PROOF_COMPLETED: {
+ case STATE_VERIFY_PROOF_COMPLETE:
if (result != OK) {
CloseConnectionWithDetails(
QUIC_PROOF_INVALID, "Proof invalid: " + error_details_);
return;
}
- ProofVerifier* verifier = session()->proof_verifier();
- DCHECK(verifier);
// Check if generation_counter has changed between STATE_VERIFY_PROOF
- // and STATE_VERIFY_PROOF_COMPLETED state changes.
+ // and STATE_VERIFY_PROOF_COMPLETE state changes.
if (generation_counter_ != cached->generation_counter()) {
next_state_ = STATE_VERIFY_PROOF;
- continue;
+ } else {
+ cached->SetProofValid();
+ next_state_ = STATE_SEND_CHLO;
}
- cached->SetProofValid();
- next_state_ = STATE_SEND_CHLO;
break;
- }
case STATE_RECV_SHLO: {
// We sent a CHLO that we expected to be accepted and now we're hoping
// for a SHLO from the server to confirm that.
@@ -265,7 +263,7 @@ void QuicCryptoClientStream::DoHandshakeLoop(
}
void QuicCryptoClientStream::OnVerifyProofComplete(int result) {
- DCHECK_EQ(STATE_VERIFY_PROOF_COMPLETED, next_state_);
+ DCHECK_EQ(STATE_VERIFY_PROOF_COMPLETE, next_state_);
DVLOG(1) << "VerifyProof completed: " << result;
DoHandshakeLoop(NULL, result);
}
« no previous file with comments | « net/quic/quic_crypto_client_stream.h ('k') | net/quic/quic_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698