| 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 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 namespace test { | 11 namespace test { |
| 12 | 12 |
| 13 // Peer for accessing otherwise private members of a QuicCryptoServerConfig. | 13 // Peer for accessing otherwise private members of a QuicCryptoServerConfig. |
| 14 class QuicCryptoServerConfigPeer { | 14 class QuicCryptoServerConfigPeer { |
| 15 public: | 15 public: |
| 16 explicit QuicCryptoServerConfigPeer( | 16 explicit QuicCryptoServerConfigPeer(QuicCryptoServerConfig* server_config) |
| 17 const QuicCryptoServerConfig* server_config) | |
| 18 : server_config_(server_config) {} | 17 : server_config_(server_config) {} |
| 19 | 18 |
| 20 // Returns the proof source. | 19 // Returns the proof source. |
| 21 ProofSource* GetProofSource(); | 20 ProofSource* GetProofSource(); |
| 22 | 21 |
| 23 // Returns the primary config. | 22 // Returns the primary config. |
| 24 QuicReferenceCountedPointer<QuicCryptoServerConfig::Config> | 23 QuicReferenceCountedPointer<QuicCryptoServerConfig::Config> |
| 25 GetPrimaryConfig(); | 24 GetPrimaryConfig(); |
| 26 | 25 |
| 27 // Returns the config associated with |config_id|. | 26 // Returns the config associated with |config_id|. |
| 28 QuicReferenceCountedPointer<QuicCryptoServerConfig::Config> GetConfig( | 27 QuicReferenceCountedPointer<QuicCryptoServerConfig::Config> GetConfig( |
| 29 std::string config_id); | 28 std::string config_id); |
| 30 | 29 |
| 31 // Returns a pointer to the ProofSource object. | 30 // Returns a pointer to the ProofSource object. |
| 32 ProofSource* GetProofSource() const; | 31 ProofSource* GetProofSource() const; |
| 33 | 32 |
| 33 // Reset the proof_source_ member. |
| 34 void ResetProofSource(std::unique_ptr<ProofSource> proof_source); |
| 35 |
| 34 // Generates a new valid source address token. | 36 // Generates a new valid source address token. |
| 35 std::string NewSourceAddressToken( | 37 std::string NewSourceAddressToken( |
| 36 std::string config_id, | 38 std::string config_id, |
| 37 SourceAddressTokens previous_tokens, | 39 SourceAddressTokens previous_tokens, |
| 38 const QuicIpAddress& ip, | 40 const QuicIpAddress& ip, |
| 39 QuicRandom* rand, | 41 QuicRandom* rand, |
| 40 QuicWallTime now, | 42 QuicWallTime now, |
| 41 CachedNetworkParameters* cached_network_params); | 43 CachedNetworkParameters* cached_network_params); |
| 42 | 44 |
| 43 // Attempts to validate the tokens in |tokens|. | 45 // Attempts to validate the tokens in |tokens|. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 const QuicReferenceCountedPointer<ProofSource::Chain>& chain, | 86 const QuicReferenceCountedPointer<ProofSource::Chain>& chain, |
| 85 const std::string& client_common_set_hashes, | 87 const std::string& client_common_set_hashes, |
| 86 const std::string& client_cached_cert_hashes, | 88 const std::string& client_cached_cert_hashes, |
| 87 const CommonCertSets* common_sets); | 89 const CommonCertSets* common_sets); |
| 88 | 90 |
| 89 uint32_t source_address_token_future_secs(); | 91 uint32_t source_address_token_future_secs(); |
| 90 | 92 |
| 91 uint32_t source_address_token_lifetime_secs(); | 93 uint32_t source_address_token_lifetime_secs(); |
| 92 | 94 |
| 93 private: | 95 private: |
| 94 const QuicCryptoServerConfig* server_config_; | 96 QuicCryptoServerConfig* server_config_; |
| 95 }; | 97 }; |
| 96 | 98 |
| 97 } // namespace test | 99 } // namespace test |
| 98 } // namespace net | 100 } // namespace net |
| 99 | 101 |
| 100 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ | 102 #endif // NET_QUIC_TEST_TOOLS_QUIC_CRYPTO_SERVER_CONFIG_PEER_H_ |
| OLD | NEW |