| 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/channel_id.h" | 10 #include "net/quic/crypto/channel_id.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 enum State { | 99 enum State { |
| 100 STATE_IDLE, | 100 STATE_IDLE, |
| 101 STATE_INITIALIZE, | 101 STATE_INITIALIZE, |
| 102 STATE_SEND_CHLO, | 102 STATE_SEND_CHLO, |
| 103 STATE_RECV_REJ, | 103 STATE_RECV_REJ, |
| 104 STATE_VERIFY_PROOF, | 104 STATE_VERIFY_PROOF, |
| 105 STATE_VERIFY_PROOF_COMPLETE, | 105 STATE_VERIFY_PROOF_COMPLETE, |
| 106 STATE_GET_CHANNEL_ID, | 106 STATE_GET_CHANNEL_ID, |
| 107 STATE_GET_CHANNEL_ID_COMPLETE, | 107 STATE_GET_CHANNEL_ID_COMPLETE, |
| 108 STATE_RECV_SHLO, | 108 STATE_RECV_SHLO, |
| 109 STATE_INITIALIZE_SCUP, |
| 110 STATE_VERIFY_PROOF_SCUP, |
| 111 STATE_VERIFY_PROOF_COMPLETE_SCUP, |
| 109 }; | 112 }; |
| 110 | 113 |
| 111 // Handles new server config and optional source-address token provided by the | 114 // Handles new server config and optional source-address token provided by the |
| 112 // server during a connection. | 115 // server during a connection. |
| 113 void HandleServerConfigUpdateMessage( | 116 void HandleServerConfigUpdateMessage( |
| 114 const CryptoHandshakeMessage& server_config_update); | 117 const CryptoHandshakeMessage& server_config_update); |
| 115 | 118 |
| 116 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 119 // DoHandshakeLoop performs a step of the handshake state machine. Note that |
| 117 // |in| may be NULL if the call did not result from a received message. | 120 // |in| may be NULL if the call did not result from a received message. |
| 118 void DoHandshakeLoop(const CryptoHandshakeMessage* in); | 121 void DoHandshakeLoop(const CryptoHandshakeMessage* in); |
| 119 | 122 |
| 123 // DoProofVeifyLoop performs a step of the proof verify state machine. |
| 124 void DoProofVeifyLoop(); |
| 125 |
| 126 // Starts the proof verification. Returns the QuicAsyncStatus returned by the |
| 127 // ProofVerifier's VerifyProof. |
| 128 QuicAsyncStatus DoVerifyProof(QuicCryptoClientConfig::CachedState* cached); |
| 129 |
| 130 // If proof is valid then it sets the proof as valid (which persists the |
| 131 // server config) and returns QUIC_NO_ERROR. If not, then it closes |
| 132 // the connection and returns QUIC_PROOF_INVALID. |
| 133 QuicErrorCode DoVerifyProofComplete( |
| 134 QuicCryptoClientConfig::CachedState* cached); |
| 135 |
| 120 // Called to set the proof of |cached| valid. Also invokes the session's | 136 // Called to set the proof of |cached| valid. Also invokes the session's |
| 121 // OnProofValid() method. | 137 // OnProofValid() method. |
| 122 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); | 138 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); |
| 123 | 139 |
| 124 // Returns true if the server crypto config in |cached| requires a ChannelID | 140 // Returns true if the server crypto config in |cached| requires a ChannelID |
| 125 // and the client config settings also allow sending a ChannelID. | 141 // and the client config settings also allow sending a ChannelID. |
| 126 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); | 142 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); |
| 127 | 143 |
| 128 QuicClientSessionBase* client_session(); | 144 QuicClientSessionBase* client_session(); |
| 129 | 145 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 bool verify_ok_; | 188 bool verify_ok_; |
| 173 string verify_error_details_; | 189 string verify_error_details_; |
| 174 scoped_ptr<ProofVerifyDetails> verify_details_; | 190 scoped_ptr<ProofVerifyDetails> verify_details_; |
| 175 | 191 |
| 176 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 192 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 177 }; | 193 }; |
| 178 | 194 |
| 179 } // namespace net | 195 } // namespace net |
| 180 | 196 |
| 181 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 197 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |