| 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 "net/quic/quic_crypto_stream.h" | 8 #include "net/quic/quic_crypto_stream.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| 11 | 11 |
| 12 class QuicSession; | 12 class QuicSession; |
| 13 struct CryptoHandshakeMessage; | 13 struct CryptoHandshakeMessage; |
| 14 | 14 |
| 15 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { | 15 class NET_EXPORT_PRIVATE QuicCryptoClientStream : public QuicCryptoStream { |
| 16 | 16 |
| 17 public: | 17 public: |
| 18 explicit QuicCryptoClientStream(QuicSession* session); | 18 explicit QuicCryptoClientStream(QuicSession* session); |
| 19 | 19 |
| 20 // CryptoFramerVisitorInterface implementation | 20 // CryptoFramerVisitorInterface implementation |
| 21 virtual void OnHandshakeMessage( | 21 virtual void OnHandshakeMessage( |
| 22 const CryptoHandshakeMessage& message) OVERRIDE; | 22 const CryptoHandshakeMessage& message) OVERRIDE; |
| 23 | 23 |
| 24 // Performs a crypto handshake with the server. Returns true if the crypto |
| 25 // handshake is started successfully. |
| 26 bool CryptoConnect(); |
| 27 |
| 24 private: | 28 private: |
| 29 void GenerateNonce(); |
| 30 |
| 31 bool FillClientHelloMessage(CryptoHandshakeMessage* message); |
| 32 |
| 33 // Data members for encoding the ClientHello message. |
| 34 // Protocol version |
| 35 uint16 version_; |
| 36 // Key exchange methods |
| 37 CryptoTagVector key_exchange_; |
| 38 // Authenticated encryption with associated data (AEAD) algorithms |
| 39 CryptoTagVector aead_; |
| 40 // Congestion control feedback types |
| 41 CryptoTagVector congestion_control_; |
| 42 // Idle connection state lifetime, in seconds |
| 43 uint32 idle_connection_state_lifetime_; |
| 44 // Keepalive timeout, in seconds, or 0 to turn off keepalive probes |
| 45 uint32 keepalive_timeout_; |
| 46 // Client's connection nonce (4-byte timestamp + 28 random bytes) |
| 47 std::string nonce_; |
| 48 // Server's hostname |
| 49 std::string server_hostname_; |
| 50 |
| 25 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 51 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 26 }; | 52 }; |
| 27 | 53 |
| 28 } // namespace net | 54 } // namespace net |
| 29 | 55 |
| 30 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 56 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |