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 28 matching lines...) Expand all Loading... |
39 ~CachedState(); | 39 ~CachedState(); |
40 | 40 |
41 // IsComplete returns true if this object contains enough information to | 41 // IsComplete returns true if this object contains enough information to |
42 // perform a handshake with the server. |now| is used to judge whether any | 42 // perform a handshake with the server. |now| is used to judge whether any |
43 // cached server config has expired. | 43 // cached server config has expired. |
44 bool IsComplete(QuicWallTime now) const; | 44 bool IsComplete(QuicWallTime now) const; |
45 | 45 |
46 // IsEmpty returns true if |server_config_| is empty. | 46 // IsEmpty returns true if |server_config_| is empty. |
47 bool IsEmpty() const; | 47 bool IsEmpty() const; |
48 | 48 |
49 // GetServerConfig returns the parsed contents of |server_config|, or NULL | 49 // GetServerConfig returns the parsed contents of |server_config|, or |
50 // if |server_config| is empty. The return value is owned by this object | 50 // nullptr if |server_config| is empty. The return value is owned by this |
51 // and is destroyed when this object is. | 51 // object and is destroyed when this object is. |
52 const CryptoHandshakeMessage* GetServerConfig() const; | 52 const CryptoHandshakeMessage* GetServerConfig() const; |
53 | 53 |
54 // SetServerConfig checks that |server_config| parses correctly and stores | 54 // SetServerConfig checks that |server_config| parses correctly and stores |
55 // it in |server_config_|. |now| is used to judge whether |server_config| | 55 // it in |server_config_|. |now| is used to judge whether |server_config| |
56 // has expired. | 56 // has expired. |
57 QuicErrorCode SetServerConfig(base::StringPiece server_config, | 57 QuicErrorCode SetServerConfig(base::StringPiece server_config, |
58 QuicWallTime now, | 58 QuicWallTime now, |
59 std::string* error_details); | 59 std::string* error_details); |
60 | 60 |
61 // InvalidateServerConfig clears the cached server config (if any). | 61 // InvalidateServerConfig clears the cached server config (if any). |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 void SetDefaults(); | 137 void SetDefaults(); |
138 | 138 |
139 // LookupOrCreate returns a CachedState for the given |server_id|. If no such | 139 // LookupOrCreate returns a CachedState for the given |server_id|. If no such |
140 // CachedState currently exists, it will be created and cached. | 140 // CachedState currently exists, it will be created and cached. |
141 CachedState* LookupOrCreate(const QuicServerId& server_id); | 141 CachedState* LookupOrCreate(const QuicServerId& server_id); |
142 | 142 |
143 // Delete all CachedState objects from cached_states_. | 143 // Delete all CachedState objects from cached_states_. |
144 void ClearCachedStates(); | 144 void ClearCachedStates(); |
145 | 145 |
146 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a | 146 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a |
147 // source-address token or SCFG from a server. If |cached| is non-NULL, the | 147 // 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 | 148 // source-address token will be taken from it. |out_params| is used in order |
149 // to store the cached certs that were sent as hints to the server in | 149 // to store the cached certs that were sent as hints to the server in |
150 // |out_params->cached_certs|. |preferred_version| is the version of the | 150 // |out_params->cached_certs|. |preferred_version| is the version of the |
151 // QUIC protocol that this client chose to use initially. This allows the | 151 // QUIC protocol that this client chose to use initially. This allows the |
152 // server to detect downgrade attacks. | 152 // server to detect downgrade attacks. |
153 void FillInchoateClientHello(const QuicServerId& server_id, | 153 void FillInchoateClientHello(const QuicServerId& server_id, |
154 const QuicVersion preferred_version, | 154 const QuicVersion preferred_version, |
155 const CachedState* cached, | 155 const CachedState* cached, |
156 QuicCryptoNegotiatedParameters* out_params, | 156 QuicCryptoNegotiatedParameters* out_params, |
157 CryptoHandshakeMessage* out) const; | 157 CryptoHandshakeMessage* out) const; |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |