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/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdarg.h> | 7 #include <stdarg.h> |
8 | 8 |
9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" | 10 #include "net/quic/crypto/aes_128_gcm_12_encrypter.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 QuicCryptoServerConfig::GenerateConfig(rand_, &clock_, options)); | 270 QuicCryptoServerConfig::GenerateConfig(rand_, &clock_, options)); |
271 override_config_protobuf_->set_source_address_token_secret_override( | 271 override_config_protobuf_->set_source_address_token_secret_override( |
272 "a secret key"); | 272 "a secret key"); |
273 // Lower priority than the default config. | 273 // Lower priority than the default config. |
274 override_config_protobuf_->set_priority(1); | 274 override_config_protobuf_->set_priority(1); |
275 override_config_.reset( | 275 override_config_.reset( |
276 server_.AddConfig(override_config_protobuf_.get(), original_time_)); | 276 server_.AddConfig(override_config_protobuf_.get(), original_time_)); |
277 } | 277 } |
278 | 278 |
279 string NewSourceAddressToken(string config_id, const IPAddressNumber& ip) { | 279 string NewSourceAddressToken(string config_id, const IPAddressNumber& ip) { |
280 return NewSourceAddressToken(config_id, ip, NULL); | 280 return NewSourceAddressToken(config_id, ip, nullptr); |
281 } | 281 } |
282 | 282 |
283 string NewSourceAddressToken(string config_id, | 283 string NewSourceAddressToken(string config_id, |
284 const IPAddressNumber& ip, | 284 const IPAddressNumber& ip, |
285 const SourceAddressTokens& previous_tokens) { | 285 const SourceAddressTokens& previous_tokens) { |
286 return peer_.NewSourceAddressToken(config_id, previous_tokens, ip, rand_, | 286 return peer_.NewSourceAddressToken(config_id, previous_tokens, ip, rand_, |
287 clock_.WallNow(), NULL); | 287 clock_.WallNow(), nullptr); |
288 } | 288 } |
289 | 289 |
290 string NewSourceAddressToken(string config_id, | 290 string NewSourceAddressToken(string config_id, |
291 const IPAddressNumber& ip, | 291 const IPAddressNumber& ip, |
292 CachedNetworkParameters* cached_network_params) { | 292 CachedNetworkParameters* cached_network_params) { |
293 SourceAddressTokens previous_tokens; | 293 SourceAddressTokens previous_tokens; |
294 return peer_.NewSourceAddressToken(config_id, previous_tokens, ip, rand_, | 294 return peer_.NewSourceAddressToken(config_id, previous_tokens, ip, rand_, |
295 clock_.WallNow(), cached_network_params); | 295 clock_.WallNow(), cached_network_params); |
296 } | 296 } |
297 | 297 |
298 HandshakeFailureReason ValidateSourceAddressTokens( | 298 HandshakeFailureReason ValidateSourceAddressTokens( |
299 string config_id, | 299 string config_id, |
300 StringPiece srct, | 300 StringPiece srct, |
301 const IPAddressNumber& ip) { | 301 const IPAddressNumber& ip) { |
302 return ValidateSourceAddressTokens(config_id, srct, ip, NULL); | 302 return ValidateSourceAddressTokens(config_id, srct, ip, nullptr); |
303 } | 303 } |
304 | 304 |
305 HandshakeFailureReason ValidateSourceAddressTokens( | 305 HandshakeFailureReason ValidateSourceAddressTokens( |
306 string config_id, | 306 string config_id, |
307 StringPiece srct, | 307 StringPiece srct, |
308 const IPAddressNumber& ip, | 308 const IPAddressNumber& ip, |
309 CachedNetworkParameters* cached_network_params) { | 309 CachedNetworkParameters* cached_network_params) { |
310 return peer_.ValidateSourceAddressTokens( | 310 return peer_.ValidateSourceAddressTokens( |
311 config_id, srct, ip, clock_.WallNow(), cached_network_params); | 311 config_id, srct, ip, clock_.WallNow(), cached_network_params); |
312 } | 312 } |
(...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 nullptr); | 758 nullptr); |
759 test_peer_.CheckConfigs( | 759 test_peer_.CheckConfigs( |
760 "a", false, | 760 "a", false, |
761 "b", true, | 761 "b", true, |
762 "c", false, | 762 "c", false, |
763 nullptr); | 763 nullptr); |
764 } | 764 } |
765 | 765 |
766 } // namespace test | 766 } // namespace test |
767 } // namespace net | 767 } // namespace net |
OLD | NEW |