| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/tools/quic/stateless_rejector.h" | 5 #include "net/tools/quic/stateless_rejector.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "net/quic/core/crypto/crypto_handshake_message.h" | 10 #include "net/quic/core/crypto/crypto_handshake_message.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 SourceAddressTokens previous_tokens; | 105 SourceAddressTokens previous_tokens; |
| 106 IPAddress ip = net::test::Loopback4(); | 106 IPAddress ip = net::test::Loopback4(); |
| 107 MockRandom rand; | 107 MockRandom rand; |
| 108 string stk = config_peer_.NewSourceAddressToken( | 108 string stk = config_peer_.NewSourceAddressToken( |
| 109 config_peer_.GetPrimaryConfig()->id, previous_tokens, ip, &rand, | 109 config_peer_.GetPrimaryConfig()->id, previous_tokens, ip, &rand, |
| 110 clock_.WallNow(), nullptr); | 110 clock_.WallNow(), nullptr); |
| 111 stk_hex_ = "#" + QuicUtils::HexEncode(stk); | 111 stk_hex_ = "#" + QuicUtils::HexEncode(stk); |
| 112 } | 112 } |
| 113 | 113 |
| 114 protected: | 114 protected: |
| 115 QuicFlagSaver flags_; // Save/restore all QUIC flag values. |
| 115 std::unique_ptr<ProofSource> proof_source_; | 116 std::unique_ptr<ProofSource> proof_source_; |
| 116 MockClock clock_; | 117 MockClock clock_; |
| 117 QuicCryptoServerConfig config_; | 118 QuicCryptoServerConfig config_; |
| 118 QuicCryptoServerConfigPeer config_peer_; | 119 QuicCryptoServerConfigPeer config_peer_; |
| 119 QuicCompressedCertsCache compressed_certs_cache_; | 120 QuicCompressedCertsCache compressed_certs_cache_; |
| 120 QuicCryptoServerConfig::ConfigOptions config_options_; | 121 QuicCryptoServerConfig::ConfigOptions config_options_; |
| 121 StatelessRejector rejector_; | 122 StatelessRejector rejector_; |
| 122 | 123 |
| 123 // Values used in CHLO messages | 124 // Values used in CHLO messages |
| 124 string scid_hex_; | 125 string scid_hex_; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) { | 234 if (GetParam().flags != ENABLED || GetParam().version <= QUIC_VERSION_32) { |
| 234 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state()); | 235 EXPECT_EQ(StatelessRejector::UNSUPPORTED, rejector_.state()); |
| 235 return; | 236 return; |
| 236 } | 237 } |
| 237 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state()); | 238 EXPECT_EQ(StatelessRejector::ACCEPTED, rejector_.state()); |
| 238 } | 239 } |
| 239 | 240 |
| 240 } // namespace | 241 } // namespace |
| 241 } // namespace test | 242 } // namespace test |
| 242 } // namespace net | 243 } // namespace net |
| OLD | NEW |