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 #ifndef NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ | 5 #ifndef NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ |
6 #define NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ | 6 #define NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ |
7 | 7 |
8 #include "net/quic/core/crypto/quic_crypto_server_config.h" | 8 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
| 9 #include "net/quic/platform/api/quic_string_piece.h" |
9 | 10 |
10 namespace net { | 11 namespace net { |
11 namespace test { | 12 namespace test { |
12 | 13 |
13 // Peer for accessing otherwise private members of a QuicCryptoServerConfig. | 14 // Peer for accessing otherwise private members of a QuicCryptoServerConfig. |
14 class QuicCryptoServerConfigPeer { | 15 class QuicCryptoServerConfigPeer { |
15 public: | 16 public: |
16 explicit QuicCryptoServerConfigPeer(QuicCryptoServerConfig* server_config) | 17 explicit QuicCryptoServerConfigPeer(QuicCryptoServerConfig* server_config) |
17 : server_config_(server_config) {} | 18 : server_config_(server_config) {} |
18 | 19 |
(...skipping 19 matching lines...) Expand all Loading... |
38 std::string config_id, | 39 std::string config_id, |
39 SourceAddressTokens previous_tokens, | 40 SourceAddressTokens previous_tokens, |
40 const QuicIpAddress& ip, | 41 const QuicIpAddress& ip, |
41 QuicRandom* rand, | 42 QuicRandom* rand, |
42 QuicWallTime now, | 43 QuicWallTime now, |
43 CachedNetworkParameters* cached_network_params); | 44 CachedNetworkParameters* cached_network_params); |
44 | 45 |
45 // Attempts to validate the tokens in |tokens|. | 46 // Attempts to validate the tokens in |tokens|. |
46 HandshakeFailureReason ValidateSourceAddressTokens( | 47 HandshakeFailureReason ValidateSourceAddressTokens( |
47 std::string config_id, | 48 std::string config_id, |
48 base::StringPiece tokens, | 49 QuicStringPiece tokens, |
49 const QuicIpAddress& ip, | 50 const QuicIpAddress& ip, |
50 QuicWallTime now, | 51 QuicWallTime now, |
51 CachedNetworkParameters* cached_network_params); | 52 CachedNetworkParameters* cached_network_params); |
52 | 53 |
53 // Attempts to validate the single source address token in |token|. | 54 // Attempts to validate the single source address token in |token|. |
54 HandshakeFailureReason ValidateSingleSourceAddressToken( | 55 HandshakeFailureReason ValidateSingleSourceAddressToken( |
55 base::StringPiece token, | 56 QuicStringPiece token, |
56 const QuicIpAddress& ip, | 57 const QuicIpAddress& ip, |
57 QuicWallTime now); | 58 QuicWallTime now); |
58 | 59 |
59 // Returns a new server nonce. | 60 // Returns a new server nonce. |
60 std::string NewServerNonce(QuicRandom* rand, QuicWallTime now) const; | 61 std::string NewServerNonce(QuicRandom* rand, QuicWallTime now) const; |
61 | 62 |
62 // CheckConfigs compares the state of the Configs in |server_config_| to the | 63 // CheckConfigs compares the state of the Configs in |server_config_| to the |
63 // description given as arguments. | 64 // description given as arguments. |
64 // The first of each pair is the server config ID of a Config. The second is a | 65 // The first of each pair is the server config ID of a Config. The second is a |
65 // boolean describing whether the config is the primary. For example: | 66 // boolean describing whether the config is the primary. For example: |
(...skipping 28 matching lines...) Expand all Loading... |
94 uint32_t source_address_token_lifetime_secs(); | 95 uint32_t source_address_token_lifetime_secs(); |
95 | 96 |
96 private: | 97 private: |
97 QuicCryptoServerConfig* server_config_; | 98 QuicCryptoServerConfig* server_config_; |
98 }; | 99 }; |
99 | 100 |
100 } // namespace test | 101 } // namespace test |
101 } // namespace net | 102 } // namespace net |
102 | 103 |
103 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ | 104 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ |
OLD | NEW |