| 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> |
| 11 | 11 |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/strings/string_piece.h" | 13 #include "base/strings/string_piece.h" |
| 14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
| 15 #include "net/quic/crypto/crypto_handshake.h" | 15 #include "net/quic/crypto/crypto_handshake.h" |
| 16 #include "net/quic/quic_protocol.h" | 16 #include "net/quic/quic_protocol.h" |
| 17 #include "net/quic/quic_server_id.h" | 17 #include "net/quic/quic_server_id.h" |
| 18 | 18 |
| 19 namespace net { | 19 namespace net { |
| 20 | 20 |
| 21 class ChannelIDKey; |
| 21 class ChannelIDSource; | 22 class ChannelIDSource; |
| 22 class CryptoHandshakeMessage; | 23 class CryptoHandshakeMessage; |
| 23 class ProofVerifier; | 24 class ProofVerifier; |
| 24 class ProofVerifyDetails; | 25 class ProofVerifyDetails; |
| 25 class QuicRandom; | 26 class QuicRandom; |
| 26 | 27 |
| 27 // QuicCryptoClientConfig contains crypto-related configuration settings for a | 28 // QuicCryptoClientConfig contains crypto-related configuration settings for a |
| 28 // client. Note that this object isn't thread-safe. It's designed to be used on | 29 // client. Note that this object isn't thread-safe. It's designed to be used on |
| 29 // a single thread at a time. | 30 // a single thread at a time. |
| 30 class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { | 31 class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 // with the |IsComplete| member of |CachedState|. | 162 // with the |IsComplete| member of |CachedState|. |
| 162 // | 163 // |
| 163 // |initial_flow_control_window_bytes| is the size of the initial flow | 164 // |initial_flow_control_window_bytes| is the size of the initial flow |
| 164 // control window this client will use for new streams. | 165 // control window this client will use for new streams. |
| 165 // | 166 // |
| 166 // |now| and |rand| are used to generate the nonce and |out_params| is | 167 // |now| and |rand| are used to generate the nonce and |out_params| is |
| 167 // filled with the results of the handshake that the server is expected to | 168 // filled with the results of the handshake that the server is expected to |
| 168 // accept. |preferred_version| is the version of the QUIC protocol that this | 169 // accept. |preferred_version| is the version of the QUIC protocol that this |
| 169 // client chose to use initially. This allows the server to detect downgrade | 170 // client chose to use initially. This allows the server to detect downgrade |
| 170 // attacks. | 171 // attacks. |
| 172 // |
| 173 // If |channel_id_key| is not null, it is used to sign a secret value derived |
| 174 // from the client and server's keys, and the Channel ID public key and the |
| 175 // signature are placed in the CETV value of the CHLO. |
| 171 QuicErrorCode FillClientHello(const QuicServerId& server_id, | 176 QuicErrorCode FillClientHello(const QuicServerId& server_id, |
| 172 QuicConnectionId connection_id, | 177 QuicConnectionId connection_id, |
| 173 const QuicVersion preferred_version, | 178 const QuicVersion preferred_version, |
| 174 uint32 initial_flow_control_window_bytes, | 179 uint32 initial_flow_control_window_bytes, |
| 175 const CachedState* cached, | 180 const CachedState* cached, |
| 176 QuicWallTime now, | 181 QuicWallTime now, |
| 177 QuicRandom* rand, | 182 QuicRandom* rand, |
| 183 const ChannelIDKey* channel_id_key, |
| 178 QuicCryptoNegotiatedParameters* out_params, | 184 QuicCryptoNegotiatedParameters* out_params, |
| 179 CryptoHandshakeMessage* out, | 185 CryptoHandshakeMessage* out, |
| 180 std::string* error_details) const; | 186 std::string* error_details) const; |
| 181 | 187 |
| 182 // ProcessRejection processes a REJ message from a server and updates the | 188 // ProcessRejection processes a REJ message from a server and updates the |
| 183 // cached information about that server. After this, |IsComplete| may return | 189 // cached information about that server. After this, |IsComplete| may return |
| 184 // true for that server's CachedState. If the rejection message contains | 190 // true for that server's CachedState. If the rejection message contains |
| 185 // state about a future handshake (i.e. an nonce value from the server), then | 191 // state about a future handshake (i.e. an nonce value from the server), then |
| 186 // it will be saved in |out_params|. |now| is used to judge whether the | 192 // it will be saved in |out_params|. |now| is used to judge whether the |
| 187 // server config in the rejection message has expired. | 193 // server config in the rejection message has expired. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 287 |
| 282 // The |user_agent_id_| passed in QUIC's CHLO message. | 288 // The |user_agent_id_| passed in QUIC's CHLO message. |
| 283 std::string user_agent_id_; | 289 std::string user_agent_id_; |
| 284 | 290 |
| 285 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 291 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
| 286 }; | 292 }; |
| 287 | 293 |
| 288 } // namespace net | 294 } // namespace net |
| 289 | 295 |
| 290 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 296 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
| OLD | NEW |