| 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 <queue> | 9 #include <queue> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // TODO(jokulik): Consider using a hash-set as extra book-keeping to ensure | 175 // TODO(jokulik): Consider using a hash-set as extra book-keeping to ensure |
| 176 // that no connection-id is added twice. Also, consider keeping the server | 176 // that no connection-id is added twice. Also, consider keeping the server |
| 177 // nonces and connection_ids together in one queue. | 177 // nonces and connection_ids together in one queue. |
| 178 std::queue<QuicConnectionId> server_designated_connection_ids_; | 178 std::queue<QuicConnectionId> server_designated_connection_ids_; |
| 179 std::queue<std::string> server_nonces_; | 179 std::queue<std::string> server_nonces_; |
| 180 | 180 |
| 181 DISALLOW_COPY_AND_ASSIGN(CachedState); | 181 DISALLOW_COPY_AND_ASSIGN(CachedState); |
| 182 }; | 182 }; |
| 183 | 183 |
| 184 QuicCryptoClientConfig(); | 184 explicit QuicCryptoClientConfig(ProofVerifier* proof_verifier); |
| 185 ~QuicCryptoClientConfig(); | 185 ~QuicCryptoClientConfig(); |
| 186 | 186 |
| 187 // LookupOrCreate returns a CachedState for the given |server_id|. If no such | 187 // LookupOrCreate returns a CachedState for the given |server_id|. If no such |
| 188 // CachedState currently exists, it will be created and cached. | 188 // CachedState currently exists, it will be created and cached. |
| 189 CachedState* LookupOrCreate(const QuicServerId& server_id); | 189 CachedState* LookupOrCreate(const QuicServerId& server_id); |
| 190 | 190 |
| 191 // Delete all CachedState objects from cached_states_. | 191 // Delete all CachedState objects from cached_states_. |
| 192 void ClearCachedStates(); | 192 void ClearCachedStates(); |
| 193 | 193 |
| 194 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a | 194 // FillInchoateClientHello sets |out| to be a CHLO message that elicits a |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // ProcessRejection processes a REJ message from a server and updates the | 232 // ProcessRejection processes a REJ message from a server and updates the |
| 233 // cached information about that server. After this, |IsComplete| may return | 233 // cached information about that server. After this, |IsComplete| may return |
| 234 // true for that server's CachedState. If the rejection message contains state | 234 // true for that server's CachedState. If the rejection message contains state |
| 235 // about a future handshake (i.e. an nonce value from the server), then it | 235 // about a future handshake (i.e. an nonce value from the server), then it |
| 236 // will be saved in |out_params|. |now| is used to judge whether the server | 236 // will be saved in |out_params|. |now| is used to judge whether the server |
| 237 // config in the rejection message has expired. |is_https| is used to track | 237 // config in the rejection message has expired. |is_https| is used to track |
| 238 // reject reason for secure vs insecure QUIC. | 238 // reject reason for secure vs insecure QUIC. |
| 239 QuicErrorCode ProcessRejection(const CryptoHandshakeMessage& rej, | 239 QuicErrorCode ProcessRejection(const CryptoHandshakeMessage& rej, |
| 240 QuicWallTime now, | 240 QuicWallTime now, |
| 241 CachedState* cached, | 241 CachedState* cached, |
| 242 bool is_https, | |
| 243 QuicCryptoNegotiatedParameters* out_params, | 242 QuicCryptoNegotiatedParameters* out_params, |
| 244 std::string* error_details); | 243 std::string* error_details); |
| 245 | 244 |
| 246 // ProcessServerHello processes the message in |server_hello|, updates the | 245 // ProcessServerHello processes the message in |server_hello|, updates the |
| 247 // cached information about that server, writes the negotiated parameters to | 246 // cached information about that server, writes the negotiated parameters to |
| 248 // |out_params| and returns QUIC_NO_ERROR. If |server_hello| is unacceptable | 247 // |out_params| and returns QUIC_NO_ERROR. If |server_hello| is unacceptable |
| 249 // then it puts an error message in |error_details| and returns an error | 248 // then it puts an error message in |error_details| and returns an error |
| 250 // code. |version| is the QUIC version for the current connection. | 249 // code. |version| is the QUIC version for the current connection. |
| 251 // |negotiated_versions| contains the list of version, if any, that were | 250 // |negotiated_versions| contains the list of version, if any, that were |
| 252 // present in a version negotiation packet previously recevied from the | 251 // present in a version negotiation packet previously recevied from the |
| (...skipping 14 matching lines...) Expand all Loading... |
| 267 // QUIC_NO_ERROR is returned. | 266 // QUIC_NO_ERROR is returned. |
| 268 QuicErrorCode ProcessServerConfigUpdate( | 267 QuicErrorCode ProcessServerConfigUpdate( |
| 269 const CryptoHandshakeMessage& server_update, | 268 const CryptoHandshakeMessage& server_update, |
| 270 QuicWallTime now, | 269 QuicWallTime now, |
| 271 CachedState* cached, | 270 CachedState* cached, |
| 272 QuicCryptoNegotiatedParameters* out_params, | 271 QuicCryptoNegotiatedParameters* out_params, |
| 273 std::string* error_details); | 272 std::string* error_details); |
| 274 | 273 |
| 275 ProofVerifier* proof_verifier() const; | 274 ProofVerifier* proof_verifier() const; |
| 276 | 275 |
| 277 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are | |
| 278 // free to use in order to verify certificate chains from servers. If a | |
| 279 // ProofVerifier is set then the client will request a certificate chain from | |
| 280 // the server. | |
| 281 void SetProofVerifier(ProofVerifier* verifier); | |
| 282 | |
| 283 ChannelIDSource* channel_id_source() const; | 276 ChannelIDSource* channel_id_source() const; |
| 284 | 277 |
| 285 // SetChannelIDSource sets a ChannelIDSource that will be called, when the | 278 // SetChannelIDSource sets a ChannelIDSource that will be called, when the |
| 286 // server supports channel IDs, to obtain a channel ID for signing a message | 279 // server supports channel IDs, to obtain a channel ID for signing a message |
| 287 // proving possession of the channel ID. This object takes ownership of | 280 // proving possession of the channel ID. This object takes ownership of |
| 288 // |source|. | 281 // |source|. |
| 289 void SetChannelIDSource(ChannelIDSource* source); | 282 void SetChannelIDSource(ChannelIDSource* source); |
| 290 | 283 |
| 291 // Initialize the CachedState from |canonical_crypto_config| for the | 284 // Initialize the CachedState from |canonical_crypto_config| for the |
| 292 // |canonical_server_id| as the initial CachedState for |server_id|. We will | 285 // |canonical_server_id| as the initial CachedState for |server_id|. We will |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 362 | 355 |
| 363 // The |user_agent_id_| passed in QUIC's CHLO message. | 356 // The |user_agent_id_| passed in QUIC's CHLO message. |
| 364 std::string user_agent_id_; | 357 std::string user_agent_id_; |
| 365 | 358 |
| 366 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 359 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
| 367 }; | 360 }; |
| 368 | 361 |
| 369 } // namespace net | 362 } // namespace net |
| 370 | 363 |
| 371 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 364 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
| OLD | NEW |