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

Side by Side Diff: net/quic/quic_crypto_client_stream.cc

Issue 885443002: Roll Chrome into Mojo. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Rebase to ToT mojo Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_fec_group_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_crypto_client_stream.h" 5 #include "net/quic/quic_crypto_client_stream.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/profiler/scoped_tracker.h" 8 #include "base/profiler/scoped_tracker.h"
9 #include "net/quic/crypto/crypto_protocol.h" 9 #include "net/quic/crypto/crypto_protocol.h"
10 #include "net/quic/crypto/crypto_utils.h" 10 #include "net/quic/crypto/crypto_utils.h"
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 next_state_ = STATE_VERIFY_PROOF; 247 next_state_ = STATE_VERIFY_PROOF;
248 } else { 248 } else {
249 next_state_ = STATE_GET_CHANNEL_ID; 249 next_state_ = STATE_GET_CHANNEL_ID;
250 } 250 }
251 } 251 }
252 252
253 void QuicCryptoClientStream::DoSendCHLO( 253 void QuicCryptoClientStream::DoSendCHLO(
254 const CryptoHandshakeMessage* in, 254 const CryptoHandshakeMessage* in,
255 QuicCryptoClientConfig::CachedState* cached) { 255 QuicCryptoClientConfig::CachedState* cached) {
256 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. 256 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
257 tracked_objects::ScopedTracker tracking_profile( 257 tracked_objects::ScopedTracker tracking_profile1(
258 FROM_HERE_WITH_EXPLICIT_FUNCTION( 258 FROM_HERE_WITH_EXPLICIT_FUNCTION(
259 "422516 QuicCryptoClientStream::DoSendCHLO")); 259 "422516 QuicCryptoClientStream::DoSendCHLO1"));
260 260
261 // Send the client hello in plaintext. 261 // Send the client hello in plaintext.
262 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_NONE); 262 session()->connection()->SetDefaultEncryptionLevel(ENCRYPTION_NONE);
263 if (num_client_hellos_ > kMaxClientHellos) { 263 if (num_client_hellos_ > kMaxClientHellos) {
264 CloseConnection(QUIC_CRYPTO_TOO_MANY_REJECTS); 264 CloseConnection(QUIC_CRYPTO_TOO_MANY_REJECTS);
265 return; 265 return;
266 } 266 }
267 num_client_hellos_++; 267 num_client_hellos_++;
268 268
269 CryptoHandshakeMessage out; 269 CryptoHandshakeMessage out;
(...skipping 30 matching lines...) Expand all
300 server_id_, 300 server_id_,
301 session()->connection()->connection_id(), 301 session()->connection()->connection_id(),
302 session()->connection()->supported_versions().front(), 302 session()->connection()->supported_versions().front(),
303 cached, 303 cached,
304 session()->connection()->clock()->WallNow(), 304 session()->connection()->clock()->WallNow(),
305 session()->connection()->random_generator(), 305 session()->connection()->random_generator(),
306 channel_id_key_.get(), 306 channel_id_key_.get(),
307 &crypto_negotiated_params_, 307 &crypto_negotiated_params_,
308 &out, 308 &out,
309 &error_details); 309 &error_details);
310
311 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
312 tracked_objects::ScopedTracker tracking_profile2(
313 FROM_HERE_WITH_EXPLICIT_FUNCTION(
314 "422516 QuicCryptoClientStream::DoSendCHLO2"));
315
310 if (error != QUIC_NO_ERROR) { 316 if (error != QUIC_NO_ERROR) {
311 // Flush the cached config so that, if it's bad, the server has a 317 // Flush the cached config so that, if it's bad, the server has a
312 // chance to send us another in the future. 318 // chance to send us another in the future.
313 cached->InvalidateServerConfig(); 319 cached->InvalidateServerConfig();
314 CloseConnectionWithDetails(error, error_details); 320 CloseConnectionWithDetails(error, error_details);
315 return; 321 return;
316 } 322 }
317 channel_id_sent_ = (channel_id_key_.get() != nullptr); 323 channel_id_sent_ = (channel_id_key_.get() != nullptr);
318 if (cached->proof_verify_details()) { 324 if (cached->proof_verify_details()) {
319 client_session()->OnProofVerifyDetailsAvailable( 325 client_session()->OnProofVerifyDetailsAvailable(
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
432 438
433 void QuicCryptoClientStream::DoVerifyProofComplete( 439 void QuicCryptoClientStream::DoVerifyProofComplete(
434 QuicCryptoClientConfig::CachedState* cached) { 440 QuicCryptoClientConfig::CachedState* cached) {
435 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed. 441 // TODO(vadimt): Remove ScopedTracker below once crbug.com/422516 is fixed.
436 tracked_objects::ScopedTracker tracking_profile( 442 tracked_objects::ScopedTracker tracking_profile(
437 FROM_HERE_WITH_EXPLICIT_FUNCTION( 443 FROM_HERE_WITH_EXPLICIT_FUNCTION(
438 "422516 QuicCryptoClientStream::DoVerifyProofComplete")); 444 "422516 QuicCryptoClientStream::DoVerifyProofComplete"));
439 445
440 if (!verify_ok_) { 446 if (!verify_ok_) {
441 next_state_ = STATE_NONE; 447 next_state_ = STATE_NONE;
442 if (verify_details_) { 448 if (verify_details_.get()) {
443 client_session()->OnProofVerifyDetailsAvailable(*verify_details_); 449 client_session()->OnProofVerifyDetailsAvailable(*verify_details_);
444 } 450 }
445 UMA_HISTOGRAM_BOOLEAN("Net.QuicVerifyProofFailed.HandshakeConfirmed", 451 UMA_HISTOGRAM_BOOLEAN("Net.QuicVerifyProofFailed.HandshakeConfirmed",
446 handshake_confirmed()); 452 handshake_confirmed());
447 CloseConnectionWithDetails( 453 CloseConnectionWithDetails(
448 QUIC_PROOF_INVALID, "Proof invalid: " + verify_error_details_); 454 QUIC_PROOF_INVALID, "Proof invalid: " + verify_error_details_);
449 return; 455 return;
450 } 456 }
451 457
452 // Check if generation_counter has changed between STATE_VERIFY_PROOF and 458 // Check if generation_counter has changed between STATE_VERIFY_PROOF and
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 } 653 }
648 } 654 }
649 return false; 655 return false;
650 } 656 }
651 657
652 QuicClientSessionBase* QuicCryptoClientStream::client_session() { 658 QuicClientSessionBase* QuicCryptoClientStream::client_session() {
653 return reinterpret_cast<QuicClientSessionBase*>(session()); 659 return reinterpret_cast<QuicClientSessionBase*>(session());
654 } 660 }
655 661
656 } // namespace net 662 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_test.cc ('k') | net/quic/quic_fec_group_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698