| OLD | NEW |
| 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/core/crypto/quic_crypto_client_config.h" | 5 #include "net/quic/core/crypto/quic_crypto_client_config.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "base/metrics/histogram_macros.h" | 11 #include "base/metrics/histogram_macros.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 #include "net/quic/core/crypto/cert_compressor.h" | 13 #include "net/quic/core/crypto/cert_compressor.h" |
| 14 #include "net/quic/core/crypto/chacha20_poly1305_encrypter.h" | 14 #include "net/quic/core/crypto/chacha20_poly1305_encrypter.h" |
| 15 #include "net/quic/core/crypto/channel_id.h" | 15 #include "net/quic/core/crypto/channel_id.h" |
| 16 #include "net/quic/core/crypto/common_cert_set.h" | 16 #include "net/quic/core/crypto/common_cert_set.h" |
| 17 #include "net/quic/core/crypto/crypto_framer.h" | 17 #include "net/quic/core/crypto/crypto_framer.h" |
| 18 #include "net/quic/core/crypto/crypto_utils.h" | 18 #include "net/quic/core/crypto/crypto_utils.h" |
| 19 #include "net/quic/core/crypto/curve25519_key_exchange.h" | 19 #include "net/quic/core/crypto/curve25519_key_exchange.h" |
| 20 #include "net/quic/core/crypto/key_exchange.h" | 20 #include "net/quic/core/crypto/key_exchange.h" |
| 21 #include "net/quic/core/crypto/p256_key_exchange.h" | 21 #include "net/quic/core/crypto/p256_key_exchange.h" |
| 22 #include "net/quic/core/crypto/proof_verifier.h" | 22 #include "net/quic/core/crypto/proof_verifier.h" |
| 23 #include "net/quic/core/crypto/quic_encrypter.h" | 23 #include "net/quic/core/crypto/quic_encrypter.h" |
| 24 #include "net/quic/core/crypto/quic_random.h" | 24 #include "net/quic/core/crypto/quic_random.h" |
| 25 #include "net/quic/core/quic_utils.h" | 25 #include "net/quic/core/quic_utils.h" |
| 26 #include "net/quic/platform/api/quic_bug_tracker.h" | 26 #include "net/quic/platform/api/quic_bug_tracker.h" |
| 27 #include "net/quic/platform/api/quic_logging.h" | |
| 28 #include "net/quic/platform/api/quic_text_utils.h" | 27 #include "net/quic/platform/api/quic_text_utils.h" |
| 29 | 28 |
| 30 using base::ContainsKey; | 29 using base::ContainsKey; |
| 31 using base::StringPiece; | 30 using base::StringPiece; |
| 32 using std::string; | 31 using std::string; |
| 33 | 32 |
| 34 namespace net { | 33 namespace net { |
| 35 | 34 |
| 36 namespace { | 35 namespace { |
| 37 | 36 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 if (server_config.empty()) { | 268 if (server_config.empty()) { |
| 270 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY); | 269 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY); |
| 271 return false; | 270 return false; |
| 272 } | 271 } |
| 273 | 272 |
| 274 string error_details; | 273 string error_details; |
| 275 ServerConfigState state = | 274 ServerConfigState state = |
| 276 SetServerConfig(server_config, now, expiration_time, &error_details); | 275 SetServerConfig(server_config, now, expiration_time, &error_details); |
| 277 RecordDiskCacheServerConfigState(state); | 276 RecordDiskCacheServerConfigState(state); |
| 278 if (state != SERVER_CONFIG_VALID) { | 277 if (state != SERVER_CONFIG_VALID) { |
| 279 QUIC_DVLOG(1) << "SetServerConfig failed with " << error_details; | 278 DVLOG(1) << "SetServerConfig failed with " << error_details; |
| 280 return false; | 279 return false; |
| 281 } | 280 } |
| 282 | 281 |
| 283 chlo_hash.CopyToString(&chlo_hash_); | 282 chlo_hash.CopyToString(&chlo_hash_); |
| 284 signature.CopyToString(&server_config_sig_); | 283 signature.CopyToString(&server_config_sig_); |
| 285 source_address_token.CopyToString(&source_address_token_); | 284 source_address_token.CopyToString(&source_address_token_); |
| 286 certs_ = certs; | 285 certs_ = certs; |
| 287 cert_sct_ = cert_sct; | 286 cert_sct_ = cert_sct; |
| 288 return true; | 287 return true; |
| 289 } | 288 } |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 978 } | 977 } |
| 979 | 978 |
| 980 // Update canonical version to point at the "most recent" entry. | 979 // Update canonical version to point at the "most recent" entry. |
| 981 canonical_server_map_[suffix_server_id] = server_id; | 980 canonical_server_map_[suffix_server_id] = server_id; |
| 982 | 981 |
| 983 server_state->InitializeFrom(*canonical_state); | 982 server_state->InitializeFrom(*canonical_state); |
| 984 return true; | 983 return true; |
| 985 } | 984 } |
| 986 | 985 |
| 987 } // namespace net | 986 } // namespace net |
| OLD | NEW |