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 ChannelIDSigner; | 21 class ChannelIDSource; |
22 class CryptoHandshakeMessage; | 22 class CryptoHandshakeMessage; |
23 class ProofVerifier; | 23 class ProofVerifier; |
24 class ProofVerifyDetails; | 24 class ProofVerifyDetails; |
25 class QuicRandom; | 25 class QuicRandom; |
26 | 26 |
27 // QuicCryptoClientConfig contains crypto-related configuration settings for a | 27 // 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 | 28 // client. Note that this object isn't thread-safe. It's designed to be used on |
29 // a single thread at a time. | 29 // a single thread at a time. |
30 class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { | 30 class NET_EXPORT_PRIVATE QuicCryptoClientConfig : public QuicCryptoConfig { |
31 public: | 31 public: |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 std::string* error_details); | 207 std::string* error_details); |
208 | 208 |
209 ProofVerifier* proof_verifier() const; | 209 ProofVerifier* proof_verifier() const; |
210 | 210 |
211 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are | 211 // SetProofVerifier takes ownership of a |ProofVerifier| that clients are |
212 // free to use in order to verify certificate chains from servers. If a | 212 // free to use in order to verify certificate chains from servers. If a |
213 // ProofVerifier is set then the client will request a certificate chain from | 213 // ProofVerifier is set then the client will request a certificate chain from |
214 // the server. | 214 // the server. |
215 void SetProofVerifier(ProofVerifier* verifier); | 215 void SetProofVerifier(ProofVerifier* verifier); |
216 | 216 |
217 ChannelIDSigner* channel_id_signer() const; | 217 ChannelIDSource* channel_id_source() const; |
218 | 218 |
219 // SetChannelIDSigner sets a ChannelIDSigner that will be called when the | 219 // SetChannelIDSource sets a ChannelIDSource that will be called, when the |
220 // server supports channel IDs to sign a message proving possession of the | 220 // server supports channel IDs, to obtain a channel ID for signing a message |
221 // given ChannelID. This object takes ownership of |signer|. | 221 // proving possession of the channel ID. This object takes ownership of |
222 void SetChannelIDSigner(ChannelIDSigner* signer); | 222 // |source|. |
| 223 void SetChannelIDSource(ChannelIDSource* source); |
223 | 224 |
224 // Initialize the CachedState from |canonical_crypto_config| for the | 225 // Initialize the CachedState from |canonical_crypto_config| for the |
225 // |canonical_server_id| as the initial CachedState for |server_id|. We will | 226 // |canonical_server_id| as the initial CachedState for |server_id|. We will |
226 // copy config data only if |canonical_crypto_config| has valid proof. | 227 // copy config data only if |canonical_crypto_config| has valid proof. |
227 void InitializeFrom(const QuicServerId& server_id, | 228 void InitializeFrom(const QuicServerId& server_id, |
228 const QuicServerId& canonical_server_id, | 229 const QuicServerId& canonical_server_id, |
229 QuicCryptoClientConfig* canonical_crypto_config); | 230 QuicCryptoClientConfig* canonical_crypto_config); |
230 | 231 |
231 // Adds |suffix| as a domain suffix for which the server's crypto config | 232 // Adds |suffix| as a domain suffix for which the server's crypto config |
232 // is expected to be shared among servers with the domain suffix. If a server | 233 // is expected to be shared among servers with the domain suffix. If a server |
(...skipping 28 matching lines...) Expand all Loading... |
261 // from a canonical host suffix/port/scheme to a representative server with | 262 // from a canonical host suffix/port/scheme to a representative server with |
262 // the canonical suffix, which has a plausible set of initial certificates | 263 // the canonical suffix, which has a plausible set of initial certificates |
263 // (or at least server public key). | 264 // (or at least server public key). |
264 std::map<QuicServerId, QuicServerId> canonical_server_map_; | 265 std::map<QuicServerId, QuicServerId> canonical_server_map_; |
265 | 266 |
266 // Contains list of suffixes (for exmaple ".c.youtube.com", | 267 // Contains list of suffixes (for exmaple ".c.youtube.com", |
267 // ".googlevideo.com") of canoncial hostnames. | 268 // ".googlevideo.com") of canoncial hostnames. |
268 std::vector<std::string> canoncial_suffixes_; | 269 std::vector<std::string> canoncial_suffixes_; |
269 | 270 |
270 scoped_ptr<ProofVerifier> proof_verifier_; | 271 scoped_ptr<ProofVerifier> proof_verifier_; |
271 scoped_ptr<ChannelIDSigner> channel_id_signer_; | 272 scoped_ptr<ChannelIDSource> channel_id_source_; |
272 | 273 |
273 // True if ECDSA should be disabled. | 274 // True if ECDSA should be disabled. |
274 bool disable_ecdsa_; | 275 bool disable_ecdsa_; |
275 | 276 |
276 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); | 277 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientConfig); |
277 }; | 278 }; |
278 | 279 |
279 } // namespace net | 280 } // namespace net |
280 | 281 |
281 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ | 282 #endif // NET_QUIC_CRYPTO_QUIC_CRYPTO_CLIENT_CONFIG_H_ |
OLD | NEW |