| 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 30 matching lines...) Expand all Loading... |
| 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_VERIFY_PROOF, | 50 STATE_VERIFY_PROOF, |
| 51 STATE_VERIFY_PROOF_COMPLETED, | 51 STATE_VERIFY_PROOF_COMPLETE, |
| 52 STATE_RECV_SHLO, | 52 STATE_RECV_SHLO, |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 55 // DoHandshakeLoop performs a step of the handshake state machine. Note that |
| 56 // |in| is NULL for the first call. | 56 // |in| is NULL for the first call. OnVerifyProofComplete passes the |result| |
| 57 // it has received from VerifyProof call (from all other places |result| is |
| 58 // set to OK). |
| 57 void DoHandshakeLoop(const CryptoHandshakeMessage* in, int result); | 59 void DoHandshakeLoop(const CryptoHandshakeMessage* in, int result); |
| 58 | 60 |
| 61 // OnVerifyProofComplete is passed as the callback method to VerifyProof. |
| 62 // ProofVerifier calls this method with the result of proof verification when |
| 63 // verification is performed asynchronously. |
| 59 void OnVerifyProofComplete(int result); | 64 void OnVerifyProofComplete(int result); |
| 60 | 65 |
| 61 base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_; | 66 base::WeakPtrFactory<QuicCryptoClientStream> weak_factory_; |
| 62 | 67 |
| 63 State next_state_; | 68 State next_state_; |
| 64 // num_client_hellos_ contains the number of client hello messages that this | 69 // num_client_hellos_ contains the number of client hello messages that this |
| 65 // connection has sent. | 70 // connection has sent. |
| 66 int num_client_hellos_; | 71 int num_client_hellos_; |
| 67 | 72 |
| 68 QuicCryptoClientConfig* const crypto_config_; | 73 QuicCryptoClientConfig* const crypto_config_; |
| 69 | 74 |
| 70 // Client's connection nonce (4-byte timestamp + 28 random bytes) | 75 // Client's connection nonce (4-byte timestamp + 28 random bytes) |
| 71 std::string nonce_; | 76 std::string nonce_; |
| 72 // Server's hostname | 77 // Server's hostname |
| 73 std::string server_hostname_; | 78 std::string server_hostname_; |
| 74 | 79 |
| 75 // Generation counter from QuicCryptoClientConfig's CachedState. | 80 // Generation counter from QuicCryptoClientConfig's CachedState. |
| 76 uint64 generation_counter_; | 81 uint64 generation_counter_; |
| 77 | 82 |
| 78 // Error details for ProofVerifier's VerifyProof call. | 83 // Error details for ProofVerifier's VerifyProof call. |
| 79 std::string error_details_; | 84 std::string error_details_; |
| 80 | 85 |
| 81 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 86 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 } // namespace net | 89 } // namespace net |
| 85 | 90 |
| 86 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 91 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |