OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_QUIC_CRYPTO_CLIENT_STREAM_H_ | 5 #ifndef NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 6 #define NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
12 #include "net/cert/cert_verify_result.h" | 12 #include "net/cert/cert_verify_result.h" |
13 #include "net/cert/x509_certificate.h" | 13 #include "net/cert/x509_certificate.h" |
14 #include "net/quic/crypto/proof_verifier.h" | 14 #include "net/quic/crypto/proof_verifier.h" |
15 #include "net/quic/crypto/quic_crypto_client_config.h" | 15 #include "net/quic/crypto/quic_crypto_client_config.h" |
16 #include "net/quic/quic_config.h" | 16 #include "net/quic/quic_config.h" |
17 #include "net/quic/quic_crypto_stream.h" | 17 #include "net/quic/quic_crypto_stream.h" |
| 18 #include "net/quic/quic_session_key.h" |
18 | 19 |
19 namespace net { | 20 namespace net { |
20 | 21 |
21 class QuicServerInfo; | 22 class QuicServerInfo; |
22 class QuicSession; | 23 class QuicSession; |
23 class SSLInfo; | 24 class SSLInfo; |
24 | 25 |
25 namespace test { | 26 namespace test { |
26 class CryptoTestUtils; | 27 class CryptoTestUtils; |
27 } // namespace test | 28 } // namespace test |
28 | 29 |
29 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { | 30 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { |
30 public: | 31 public: |
31 QuicCryptoClientStream(const string& server_hostname, | 32 QuicCryptoClientStream(const QuicSessionKey& server_key, |
32 QuicSession* session, | 33 QuicSession* session, |
33 QuicCryptoClientConfig* crypto_config); | 34 QuicCryptoClientConfig* crypto_config); |
34 virtual ~QuicCryptoClientStream(); | 35 virtual ~QuicCryptoClientStream(); |
35 | 36 |
36 // CryptoFramerVisitorInterface implementation | 37 // CryptoFramerVisitorInterface implementation |
37 virtual void OnHandshakeMessage( | 38 virtual void OnHandshakeMessage( |
38 const CryptoHandshakeMessage& message) OVERRIDE; | 39 const CryptoHandshakeMessage& message) OVERRIDE; |
39 | 40 |
40 // Performs a crypto handshake with the server. Returns true if the crypto | 41 // Performs a crypto handshake with the server. Returns true if the crypto |
41 // handshake is started successfully. | 42 // handshake is started successfully. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 112 |
112 State next_state_; | 113 State next_state_; |
113 // num_client_hellos_ contains the number of client hello messages that this | 114 // num_client_hellos_ contains the number of client hello messages that this |
114 // connection has sent. | 115 // connection has sent. |
115 int num_client_hellos_; | 116 int num_client_hellos_; |
116 | 117 |
117 QuicCryptoClientConfig* const crypto_config_; | 118 QuicCryptoClientConfig* const crypto_config_; |
118 | 119 |
119 // Client's connection nonce (4-byte timestamp + 28 random bytes) | 120 // Client's connection nonce (4-byte timestamp + 28 random bytes) |
120 std::string nonce_; | 121 std::string nonce_; |
121 // Server's hostname | 122 // Server's (hostname, port, is_https) tuple. |
122 std::string server_hostname_; | 123 const QuicSessionKey server_key_; |
123 | 124 |
124 // Generation counter from QuicCryptoClientConfig's CachedState. | 125 // Generation counter from QuicCryptoClientConfig's CachedState. |
125 uint64 generation_counter_; | 126 uint64 generation_counter_; |
126 | 127 |
127 // proof_verify_callback_ contains the callback object that we passed to an | 128 // proof_verify_callback_ contains the callback object that we passed to an |
128 // asynchronous proof verification. The ProofVerifier owns this object. | 129 // asynchronous proof verification. The ProofVerifier owns this object. |
129 ProofVerifierCallbackImpl* proof_verify_callback_; | 130 ProofVerifierCallbackImpl* proof_verify_callback_; |
130 | 131 |
131 // These members are used to store the result of an asynchronous proof | 132 // These members are used to store the result of an asynchronous proof |
132 // verification. These members must not be used after | 133 // verification. These members must not be used after |
(...skipping 16 matching lines...) Expand all Loading... |
149 base::TimeTicks disk_cache_load_start_time_; | 150 base::TimeTicks disk_cache_load_start_time_; |
150 | 151 |
151 base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_; | 152 base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_; |
152 | 153 |
153 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 154 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
154 }; | 155 }; |
155 | 156 |
156 } // namespace net | 157 } // namespace net |
157 | 158 |
158 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 159 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
OLD | NEW |