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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // present in a version negotiation packet previously recevied from the | 201 // present in a version negotiation packet previously recevied from the |
202 // server. The contents of this list will be compared against the list of | 202 // server. The contents of this list will be compared against the list of |
203 // versions provided in the VER tag of the server hello. | 203 // versions provided in the VER tag of the server hello. |
204 QuicErrorCode ProcessServerHello(const CryptoHandshakeMessage& server_hello, | 204 QuicErrorCode ProcessServerHello(const CryptoHandshakeMessage& server_hello, |
205 QuicConnectionId connection_id, | 205 QuicConnectionId connection_id, |
206 const QuicVersionVector& negotiated_versions, | 206 const QuicVersionVector& negotiated_versions, |
207 CachedState* cached, | 207 CachedState* cached, |
208 QuicCryptoNegotiatedParameters* out_params, | 208 QuicCryptoNegotiatedParameters* out_params, |
209 std::string* error_details); | 209 std::string* error_details); |
210 | 210 |
| 211 // Processes the message in |server_update|, updating the cached source |
| 212 // address token, and server config. |
| 213 // If |server_update| is invalid then |error_details| will contain an error |
| 214 // message, and an error code will be returned. If all has gone well |
| 215 // QUIC_NO_ERROR is returned. |
| 216 QuicErrorCode ProcessServerConfigUpdate( |
| 217 const CryptoHandshakeMessage& server_update, |
| 218 QuicWallTime now, |
| 219 CachedState* cached, |
| 220 QuicCryptoNegotiatedParameters* out_params, |
| 221 std::string* error_details); |
| 222 |
211 ProofVerifier* proof_verifier() const; | 223 ProofVerifier* proof_verifier() const; |
212 | 224 |
213 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are | 225 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are |
214 // free to use in order to verify certificate chains from servers. If a | 226 // free to use in order to verify certificate chains from servers. If a |
215 // ProofVerifier is set then the client will request a certificate chain from | 227 // ProofVerifier is set then the client will request a certificate chain from |
216 // the server. | 228 // the server. |
217 void SetProofVerifier(ProofVerifier* verifier); | 229 void SetProofVerifier(ProofVerifier* verifier); |
218 | 230 |
219 ChannelIDSource* channel_id_source() const; | 231 ChannelIDSource* channel_id_source() const; |
220 | 232 |
(...skipping 27 matching lines...) Expand all Loading... |
248 void DisableEcdsa(); | 260 void DisableEcdsa(); |
249 | 261 |
250 // Saves the |user_agent_id| that will be passed in QUIC's CHLO message. | 262 // Saves the |user_agent_id| that will be passed in QUIC's CHLO message. |
251 void set_user_agent_id(const std::string& user_agent_id) { | 263 void set_user_agent_id(const std::string& user_agent_id) { |
252 user_agent_id_ = user_agent_id; | 264 user_agent_id_ = user_agent_id; |
253 } | 265 } |
254 | 266 |
255 private: | 267 private: |
256 typedef std::map<QuicServerId, CachedState*> CachedStateMap; | 268 typedef std::map<QuicServerId, CachedState*> CachedStateMap; |
257 | 269 |
| 270 // CacheNewServerConfig checks for SCFG, STK, PROF, and CRT tags in |message|, |
| 271 // verifies them, and stores them in the cached state if they validate. |
| 272 // This is used on receipt of a REJ from a server, or when a server sends |
| 273 // updated server config during a connection. |
| 274 QuicErrorCode CacheNewServerConfig( |
| 275 const CryptoHandshakeMessage& message, |
| 276 QuicWallTime now, |
| 277 const std::vector<std::string>& cached_certs, |
| 278 CachedState* cached, |
| 279 std::string* error_details); |
| 280 |
258 // If the suffix of the hostname in |server_id| is in |canoncial_suffixes_|, | 281 // If the suffix of the hostname in |server_id| is in |canoncial_suffixes_|, |
259 // then populate |cached| with the canonical cached state from | 282 // then populate |cached| with the canonical cached state from |
260 // |canonical_server_map_| for that suffix. | 283 // |canonical_server_map_| for that suffix. |
261 void PopulateFromCanonicalConfig(const QuicServerId& server_id, | 284 void PopulateFromCanonicalConfig(const QuicServerId& server_id, |
262 CachedState* cached); | 285 CachedState* cached); |
263 | 286 |
264 // cached_states_ maps from the server_id to the cached information about | 287 // cached_states_ maps from the server_id to the cached information about |
265 // that server. | 288 // that server. |
266 CachedStateMap cached_states_; | 289 CachedStateMap cached_states_; |
267 | 290 |
(...skipping 15 matching lines...) Expand all Loading... |
283 | 306 |
284 // The |user_agent_id_| passed in QUIC's CHLO message. | 307 // The |user_agent_id_| passed in QUIC's CHLO message. |
285 std::string user_agent_id_; | 308 std::string user_agent_id_; |
286 | 309 |
287 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 310 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
288 }; | 311 }; |
289 | 312 |
290 } // namespace net | 313 } // namespace net |
291 | 314 |
292 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 315 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
OLD | NEW |