| 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/crypto/crypto_handshake.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 // than the number of round-trips needed for the handshake. | 40 // than the number of round-trips needed for the handshake. |
| 41 int num_sent_client_hellos() const; | 41 int num_sent_client_hellos() const; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 friend class test::CryptoTestUtils; | 44 friend class test::CryptoTestUtils; |
| 45 | 45 |
| 46 enum State { | 46 enum State { |
| 47 STATE_IDLE, | 47 STATE_IDLE, |
| 48 STATE_SEND_CHLO, | 48 STATE_SEND_CHLO, |
| 49 STATE_RECV_REJ, | 49 STATE_RECV_REJ, |
| 50 STATE_PROOF_VERIFICATION_COMPLETED, |
| 50 STATE_RECV_SHLO, | 51 STATE_RECV_SHLO, |
| 51 }; | 52 }; |
| 52 | 53 |
| 53 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 54 // DoHandshakeLoop performs a step of the handshake state machine. Note that |
| 54 // |in| is NULL for the first call. | 55 // |in| is NULL for the first call. |
| 55 void DoHandshakeLoop(const CryptoHandshakeMessage* in); | 56 void DoHandshakeLoop(const CryptoHandshakeMessage* in); |
| 56 | 57 |
| 58 void VerifyProofCompleted(int result); |
| 59 |
| 57 State next_state_; | 60 State next_state_; |
| 58 // num_client_hellos_ contains the number of client hello messages that this | 61 // num_client_hellos_ contains the number of client hello messages that this |
| 59 // connection has sent. | 62 // connection has sent. |
| 60 int num_client_hellos_; | 63 int num_client_hellos_; |
| 61 | 64 |
| 62 QuicCryptoClientConfig* const crypto_config_; | 65 QuicCryptoClientConfig* const crypto_config_; |
| 63 | 66 |
| 64 // Client's connection nonce (4-byte timestamp + 28 random bytes) | 67 // Client's connection nonce (4-byte timestamp + 28 random bytes) |
| 65 std::string nonce_; | 68 std::string nonce_; |
| 66 // Server's hostname | 69 // Server's hostname |
| 67 std::string server_hostname_; | 70 std::string server_hostname_; |
| 68 | 71 |
| 69 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 72 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 70 }; | 73 }; |
| 71 | 74 |
| 72 } // namespace net | 75 } // namespace net |
| 73 | 76 |
| 74 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 77 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |