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

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

Issue 1818393003: QUIC - Persist "Hash of the CHLO message" and "Signed timestamp of the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Default chlo_hash to empty string for old disk cache data Created 4 years, 9 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/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_server_info.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/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "net/quic/crypto/cert_compressor.h" 10 #include "net/quic/crypto/cert_compressor.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 void QuicCryptoClientConfig::CachedState::SetProofInvalid() { 247 void QuicCryptoClientConfig::CachedState::SetProofInvalid() {
248 server_config_valid_ = false; 248 server_config_valid_ = false;
249 ++generation_counter_; 249 ++generation_counter_;
250 } 250 }
251 251
252 bool QuicCryptoClientConfig::CachedState::Initialize( 252 bool QuicCryptoClientConfig::CachedState::Initialize(
253 StringPiece server_config, 253 StringPiece server_config,
254 StringPiece source_address_token, 254 StringPiece source_address_token,
255 const vector<string>& certs, 255 const vector<string>& certs,
256 const string& cert_sct, 256 StringPiece cert_sct,
257 StringPiece chlo_hash, 257 StringPiece chlo_hash,
258 StringPiece signature, 258 StringPiece signature,
259 QuicWallTime now) { 259 QuicWallTime now) {
260 DCHECK(server_config_.empty()); 260 DCHECK(server_config_.empty());
261 261
262 if (server_config.empty()) { 262 if (server_config.empty()) {
263 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY); 263 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY);
264 return false; 264 return false;
265 } 265 }
266 266
267 string error_details; 267 string error_details;
268 ServerConfigState state = SetServerConfig(server_config, now, &error_details); 268 ServerConfigState state = SetServerConfig(server_config, now, &error_details);
269 RecordDiskCacheServerConfigState(state); 269 RecordDiskCacheServerConfigState(state);
270 if (state != SERVER_CONFIG_VALID) { 270 if (state != SERVER_CONFIG_VALID) {
271 DVLOG(1) << "SetServerConfig failed with " << error_details; 271 DVLOG(1) << "SetServerConfig failed with " << error_details;
272 return false; 272 return false;
273 } 273 }
274 274
275 chlo_hash.CopyToString(&chlo_hash_);
276 signature.CopyToString(&server_config_sig_); 275 signature.CopyToString(&server_config_sig_);
277 source_address_token.CopyToString(&source_address_token_); 276 source_address_token.CopyToString(&source_address_token_);
277 cert_sct.CopyToString(&cert_sct_);
278 chlo_hash.CopyToString(&chlo_hash_);
278 certs_ = certs; 279 certs_ = certs;
279 cert_sct_ = cert_sct;
280 return true; 280 return true;
281 } 281 }
282 282
283 const string& QuicCryptoClientConfig::CachedState::server_config() const { 283 const string& QuicCryptoClientConfig::CachedState::server_config() const {
284 return server_config_; 284 return server_config_;
285 } 285 }
286 286
287 const string& QuicCryptoClientConfig::CachedState::source_address_token() 287 const string& QuicCryptoClientConfig::CachedState::source_address_token()
288 const { 288 const {
289 return source_address_token_; 289 return source_address_token_;
(...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 } 984 }
985 985
986 // Update canonical version to point at the "most recent" entry. 986 // Update canonical version to point at the "most recent" entry.
987 canonical_server_map_[suffix_server_id] = server_id; 987 canonical_server_map_[suffix_server_id] = server_id;
988 988
989 server_state->InitializeFrom(*canonical_state); 989 server_state->InitializeFrom(*canonical_state);
990 return true; 990 return true;
991 } 991 }
992 992
993 } // namespace net 993 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_server_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698