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