| 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 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 5 #ifndef NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
| 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 6 #define NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 | 126 |
| 127 // scfg contains the cached, parsed value of |server_config|. | 127 // scfg contains the cached, parsed value of |server_config|. |
| 128 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; | 128 mutable scoped_ptr<CryptoHandshakeMessage> scfg_; |
| 129 | 129 |
| 130 DISALLOW_COPY_AND_ASSIGN(CachedState); | 130 DISALLOW_COPY_AND_ASSIGN(CachedState); |
| 131 }; | 131 }; |
| 132 | 132 |
| 133 QuicCryptoClientConfig(); | 133 QuicCryptoClientConfig(); |
| 134 ~QuicCryptoClientConfig(); | 134 ~QuicCryptoClientConfig(); |
| 135 | 135 |
| 136 // Sets the members to reasonable, default values. | |
| 137 void SetDefaults(); | |
| 138 | |
| 139 // LookupOrCreate returns a CachedState for the given |server_id|. If no such | 136 // LookupOrCreate returns a CachedState for the given |server_id|. If no such |
| 140 // CachedState currently exists, it will be created and cached. | 137 // CachedState currently exists, it will be created and cached. |
| 141 CachedState* LookupOrCreate(const QuicServerId& server_id); | 138 CachedState* LookupOrCreate(const QuicServerId& server_id); |
| 142 | 139 |
| 143 // Delete all CachedState objects from cached_states_. | 140 // Delete all CachedState objects from cached_states_. |
| 144 void ClearCachedStates(); | 141 void ClearCachedStates(); |
| 145 | 142 |
| 146 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a | 143 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a |
| 147 // source-address token or SCFG from a server. If |cached| is non-nullptr, the | 144 // source-address token or SCFG from a server. If |cached| is non-nullptr, the |
| 148 // source-address token will be taken from it. |out_params| is used in order | 145 // source-address token will be taken from it. |out_params| is used in order |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 void DisableEcdsa(); | 259 void DisableEcdsa(); |
| 263 | 260 |
| 264 // Saves the |user_agent_id| that will be passed in QUIC's CHLO message. | 261 // Saves the |user_agent_id| that will be passed in QUIC's CHLO message. |
| 265 void set_user_agent_id(const std::string& user_agent_id) { | 262 void set_user_agent_id(const std::string& user_agent_id) { |
| 266 user_agent_id_ = user_agent_id; | 263 user_agent_id_ = user_agent_id; |
| 267 } | 264 } |
| 268 | 265 |
| 269 private: | 266 private: |
| 270 typedef std::map<QuicServerId, CachedState*> CachedStateMap; | 267 typedef std::map<QuicServerId, CachedState*> CachedStateMap; |
| 271 | 268 |
| 269 // Sets the members to reasonable, default values. |
| 270 void SetDefaults(); |
| 271 |
| 272 // CacheNewServerConfig checks for SCFG, STK, PROF, and CRT tags in |message|, | 272 // CacheNewServerConfig checks for SCFG, STK, PROF, and CRT tags in |message|, |
| 273 // verifies them, and stores them in the cached state if they validate. | 273 // verifies them, and stores them in the cached state if they validate. |
| 274 // This is used on receipt of a REJ from a server, or when a server sends | 274 // This is used on receipt of a REJ from a server, or when a server sends |
| 275 // updated server config during a connection. | 275 // updated server config during a connection. |
| 276 QuicErrorCode CacheNewServerConfig( | 276 QuicErrorCode CacheNewServerConfig( |
| 277 const CryptoHandshakeMessage& message, | 277 const CryptoHandshakeMessage& message, |
| 278 QuicWallTime now, | 278 QuicWallTime now, |
| 279 const std::vector<std::string>& cached_certs, | 279 const std::vector<std::string>& cached_certs, |
| 280 CachedState* cached, | 280 CachedState* cached, |
| 281 std::string* error_details); | 281 std::string* error_details); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 308 | 308 |
| 309 // The |user_agent_id_| passed in QUIC's CHLO message. | 309 // The |user_agent_id_| passed in QUIC's CHLO message. |
| 310 std::string user_agent_id_; | 310 std::string user_agent_id_; |
| 311 | 311 |
| 312 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 312 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
| 313 }; | 313 }; |
| 314 | 314 |
| 315 } // namespace net | 315 } // namespace net |
| 316 | 316 |
| 317 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 317 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
| OLD | NEW |