| 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" |
| 27 #include "net/quic/platform/api/quic_text_utils.h" | 28 #include "net/quic/platform/api/quic_text_utils.h" |
| 28 | 29 |
| 29 using base::ContainsKey; | 30 using base::ContainsKey; |
| 30 using base::StringPiece; | 31 using base::StringPiece; |
| 31 using std::string; | 32 using std::string; |
| 32 | 33 |
| 33 namespace net { | 34 namespace net { |
| 34 | 35 |
| 35 namespace { | 36 namespace { |
| 36 | 37 |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 if (server_config.empty()) { | 269 if (server_config.empty()) { |
| 269 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY); | 270 RecordDiskCacheServerConfigState(SERVER_CONFIG_EMPTY); |
| 270 return false; | 271 return false; |
| 271 } | 272 } |
| 272 | 273 |
| 273 string error_details; | 274 string error_details; |
| 274 ServerConfigState state = | 275 ServerConfigState state = |
| 275 SetServerConfig(server_config, now, expiration_time, &error_details); | 276 SetServerConfig(server_config, now, expiration_time, &error_details); |
| 276 RecordDiskCacheServerConfigState(state); | 277 RecordDiskCacheServerConfigState(state); |
| 277 if (state != SERVER_CONFIG_VALID) { | 278 if (state != SERVER_CONFIG_VALID) { |
| 278 DVLOG(1) << "SetServerConfig failed with " << error_details; | 279 QUIC_DVLOG(1) << "SetServerConfig failed with " << error_details; |
| 279 return false; | 280 return false; |
| 280 } | 281 } |
| 281 | 282 |
| 282 chlo_hash.CopyToString(&chlo_hash_); | 283 chlo_hash.CopyToString(&chlo_hash_); |
| 283 signature.CopyToString(&server_config_sig_); | 284 signature.CopyToString(&server_config_sig_); |
| 284 source_address_token.CopyToString(&source_address_token_); | 285 source_address_token.CopyToString(&source_address_token_); |
| 285 certs_ = certs; | 286 certs_ = certs; |
| 286 cert_sct_ = cert_sct; | 287 cert_sct_ = cert_sct; |
| 287 return true; | 288 return true; |
| 288 } | 289 } |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 } | 978 } |
| 978 | 979 |
| 979 // Update canonical version to point at the "most recent" entry. | 980 // Update canonical version to point at the "most recent" entry. |
| 980 canonical_server_map_[suffix_server_id] = server_id; | 981 canonical_server_map_[suffix_server_id] = server_id; |
| 981 | 982 |
| 982 server_state->InitializeFrom(*canonical_state); | 983 server_state->InitializeFrom(*canonical_state); |
| 983 return true; | 984 return true; |
| 984 } | 985 } |
| 985 | 986 |
| 986 } // namespace net | 987 } // namespace net |
| OLD | NEW |