| 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" |
| 11 #include "net/quic/crypto/crypto_handshake_message.h" | 11 #include "net/quic/crypto/crypto_handshake_message.h" |
| 12 #include "net/quic/crypto/crypto_secret_boxer.h" | 12 #include "net/quic/crypto/crypto_secret_boxer.h" |
| 13 #include "net/quic/crypto/crypto_server_config_protobuf.h" | 13 #include "net/quic/crypto/crypto_server_config_protobuf.h" |
| 14 #include "net/quic/crypto/quic_random.h" | 14 #include "net/quic/crypto/quic_random.h" |
| 15 #include "net/quic/crypto/strike_register_client.h" | 15 #include "net/quic/crypto/strike_register_client.h" |
| 16 #include "net/quic/quic_flags.h" | |
| 17 #include "net/quic/quic_time.h" | 16 #include "net/quic/quic_time.h" |
| 18 #include "net/quic/test_tools/mock_clock.h" | 17 #include "net/quic/test_tools/mock_clock.h" |
| 19 #include "net/quic/test_tools/quic_test_utils.h" | 18 #include "net/quic/test_tools/quic_test_utils.h" |
| 20 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
| 21 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
| 22 | 21 |
| 23 using base::StringPiece; | 22 using base::StringPiece; |
| 24 using std::make_pair; | 23 using std::make_pair; |
| 25 using std::map; | 24 using std::map; |
| 26 using std::pair; | 25 using std::pair; |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 new TestStrikeRegisterClient(&server); | 251 new TestStrikeRegisterClient(&server); |
| 253 server.SetStrikeRegisterClient(strike_register); | 252 server.SetStrikeRegisterClient(strike_register); |
| 254 | 253 |
| 255 QuicCryptoServerConfig::ConfigOptions options; | 254 QuicCryptoServerConfig::ConfigOptions options; |
| 256 scoped_ptr<CryptoHandshakeMessage>( | 255 scoped_ptr<CryptoHandshakeMessage>( |
| 257 server.AddDefaultConfig(rand, &clock, options)); | 256 server.AddDefaultConfig(rand, &clock, options)); |
| 258 EXPECT_TRUE(strike_register->is_known_orbit_called()); | 257 EXPECT_TRUE(strike_register->is_known_orbit_called()); |
| 259 } | 258 } |
| 260 | 259 |
| 261 TEST(QuicCryptoServerConfigTest, SourceAddressTokens) { | 260 TEST(QuicCryptoServerConfigTest, SourceAddressTokens) { |
| 262 ValueRestore<bool> old_flag(&FLAGS_quic_store_cached_network_params_from_chlo, | |
| 263 true); | |
| 264 const string kPrimary = "<primary>"; | 261 const string kPrimary = "<primary>"; |
| 265 const string kOverride = "Config with custom source address token key"; | 262 const string kOverride = "Config with custom source address token key"; |
| 266 | 263 |
| 267 MockClock clock; | 264 MockClock clock; |
| 268 clock.AdvanceTime(QuicTime::Delta::FromSeconds(1000000)); | 265 clock.AdvanceTime(QuicTime::Delta::FromSeconds(1000000)); |
| 269 | 266 |
| 270 QuicWallTime now = clock.WallNow(); | 267 QuicWallTime now = clock.WallNow(); |
| 271 const QuicWallTime original_time = now; | 268 const QuicWallTime original_time = now; |
| 272 | 269 |
| 273 QuicRandom* rand = QuicRandom::GetInstance(); | 270 QuicRandom* rand = QuicRandom::GetInstance(); |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 695 nullptr); | 692 nullptr); |
| 696 test_peer_.CheckConfigs( | 693 test_peer_.CheckConfigs( |
| 697 "a", false, | 694 "a", false, |
| 698 "b", true, | 695 "b", true, |
| 699 "c", false, | 696 "c", false, |
| 700 nullptr); | 697 nullptr); |
| 701 } | 698 } |
| 702 | 699 |
| 703 } // namespace test | 700 } // namespace test |
| 704 } // namespace net | 701 } // namespace net |
| OLD | NEW |