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

Side by Side Diff: net/quic/crypto/quic_crypto_client_config.cc

Issue 159143007: Log QUIC public reset client address mismatch to a histogram. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Address review comments Created 6 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 | Annotate | Revision Log
« no previous file with comments | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/quic_connection_logger.h » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/crypto/quic_crypto_client_config.h" 5 #include "net/quic/crypto/quic_crypto_client_config.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "net/quic/crypto/cert_compressor.h" 8 #include "net/quic/crypto/cert_compressor.h"
9 #include "net/quic/crypto/channel_id.h" 9 #include "net/quic/crypto/channel_id.h"
10 #include "net/quic/crypto/common_cert_set.h" 10 #include "net/quic/crypto/common_cert_set.h"
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
603 603
604 // Learn about updated source address tokens. 604 // Learn about updated source address tokens.
605 StringPiece token; 605 StringPiece token;
606 if (server_hello.GetStringPiece(kSourceAddressTokenTag, &token)) { 606 if (server_hello.GetStringPiece(kSourceAddressTokenTag, &token)) {
607 cached->set_source_address_token(token); 607 cached->set_source_address_token(token);
608 } 608 }
609 609
610 // TODO(agl): 610 // TODO(agl):
611 // learn about updated SCFGs. 611 // learn about updated SCFGs.
612 612
613 StringPiece address;
614 if (server_hello.GetStringPiece(kCADR, &address)) {
615 out_params->client_address.assign(address.data(), address.size());
616 }
617
618 StringPiece public_value; 613 StringPiece public_value;
619 if (!server_hello.GetStringPiece(kPUBS, &public_value)) { 614 if (!server_hello.GetStringPiece(kPUBS, &public_value)) {
620 *error_details = "server hello missing forward secure public value"; 615 *error_details = "server hello missing forward secure public value";
621 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; 616 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
622 } 617 }
623 618
624 if (!out_params->client_key_exchange->CalculateSharedKey( 619 if (!out_params->client_key_exchange->CalculateSharedKey(
625 public_value, &out_params->forward_secure_premaster_secret)) { 620 public_value, &out_params->forward_secure_premaster_secret)) {
626 *error_details = "Key exchange failure"; 621 *error_details = "Key exchange failure";
627 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; 622 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 CachedState* canonical_cached = 662 CachedState* canonical_cached =
668 canonical_crypto_config->LookupOrCreate(canonical_server_hostname); 663 canonical_crypto_config->LookupOrCreate(canonical_server_hostname);
669 if (!canonical_cached->proof_valid()) { 664 if (!canonical_cached->proof_valid()) {
670 return; 665 return;
671 } 666 }
672 CachedState* cached = LookupOrCreate(server_hostname); 667 CachedState* cached = LookupOrCreate(server_hostname);
673 cached->InitializeFrom(*canonical_cached); 668 cached->InitializeFrom(*canonical_cached);
674 } 669 }
675 670
676 } // namespace net 671 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/crypto_server_test.cc ('k') | net/quic/quic_connection_logger.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698