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 "net/quic/crypto/crypto_handshake.h" |
10 #include "net/quic/quic_crypto_stream.h" | 11 #include "net/quic/quic_crypto_stream.h" |
11 | 12 |
12 namespace net { | 13 namespace net { |
13 | 14 |
14 class QuicSession; | 15 class QuicSession; |
15 struct CryptoHandshakeMessage; | 16 struct CryptoHandshakeMessage; |
16 | 17 |
17 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { | 18 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { |
18 | 19 |
19 public: | 20 public: |
20 QuicCryptoClientStream(QuicSession* session, const string& server_hostname); | 21 QuicCryptoClientStream(QuicSession* session, const string& server_hostname); |
21 | 22 |
22 // CryptoFramerVisitorInterface implementation | 23 // CryptoFramerVisitorInterface implementation |
23 virtual void OnHandshakeMessage( | 24 virtual void OnHandshakeMessage( |
24 const CryptoHandshakeMessage& message) OVERRIDE; | 25 const CryptoHandshakeMessage& message) OVERRIDE; |
25 | 26 |
26 // Performs a crypto handshake with the server. Returns true if the crypto | 27 // Performs a crypto handshake with the server. Returns true if the crypto |
27 // handshake is started successfully. | 28 // handshake is started successfully. |
28 bool CryptoConnect(); | 29 bool CryptoConnect(); |
29 | 30 |
30 private: | 31 private: |
31 QuicCryptoConfig crypto_config_; | 32 QuicCryptoClientConfig crypto_config_; |
32 // Client's connection nonce (4-byte timestamp + 28 random bytes) | 33 // Client's connection nonce (4-byte timestamp + 28 random bytes) |
33 std::string nonce_; | 34 std::string nonce_; |
34 // Server's hostname | 35 // Server's hostname |
35 std::string server_hostname_; | 36 std::string server_hostname_; |
36 | 37 |
37 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 38 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
38 }; | 39 }; |
39 | 40 |
40 } // namespace net | 41 } // namespace net |
41 | 42 |
42 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 43 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
OLD | NEW |