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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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, | 109 STATE_INITIALIZE_SCUP, |
110 STATE_VERIFY_PROOF_DONE, | 110 STATE_NONE, |
111 }; | 111 }; |
112 | 112 |
113 // Handles new server config and optional source-address token provided by the | 113 // Handles new server config and optional source-address token provided by the |
114 // server during a connection. | 114 // server during a connection. |
115 void HandleServerConfigUpdateMessage( | 115 void HandleServerConfigUpdateMessage( |
116 const CryptoHandshakeMessage& server_config_update); | 116 const CryptoHandshakeMessage& server_config_update); |
117 | 117 |
118 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 118 // DoHandshakeLoop performs a step of the handshake state machine. Note that |
119 // |in| may be NULL if the call did not result from a received message. | 119 // |in| may be NULL if the call did not result from a received message. |
120 void DoHandshakeLoop(const CryptoHandshakeMessage* in); | 120 void DoHandshakeLoop(const CryptoHandshakeMessage* in); |
121 | 121 |
| 122 // Start the handshake process. |
| 123 void DoInitialize(QuicCryptoClientConfig::CachedState* cached); |
| 124 |
| 125 // Send either InchoateClientHello or ClientHello message to the server. |
| 126 void DoSendCHLO(const CryptoHandshakeMessage* in, |
| 127 QuicCryptoClientConfig::CachedState* cached); |
| 128 |
| 129 // Process REJ message from the server. |
| 130 void DoReceiveREJ(const CryptoHandshakeMessage* in, |
| 131 QuicCryptoClientConfig::CachedState* cached); |
| 132 |
| 133 // Start the proof verification process. Returns the QuicAsyncStatus returned |
| 134 // by the ProofVerifier's VerifyProof. |
| 135 QuicAsyncStatus DoVerifyProof(QuicCryptoClientConfig::CachedState* cached); |
| 136 |
| 137 // If proof is valid then it sets the proof as valid (which persists the |
| 138 // server config). If not, it closes the connection. |
| 139 void DoVerifyProofComplete(QuicCryptoClientConfig::CachedState* cached); |
| 140 |
| 141 // Start the look up of Channel ID process. Returns either QUIC_SUCCESS if |
| 142 // RequiresChannelID returns false or QuicAsyncStatus returned by |
| 143 // GetChannelIDKey. |
| 144 QuicAsyncStatus DoGetChannelID(QuicCryptoClientConfig::CachedState* cached); |
| 145 |
| 146 // If there is no channel ID, then close the connection otherwise transtion to |
| 147 // STATE_SEND_CHLO state. |
| 148 void DoGetChannelIDComplete(); |
| 149 |
| 150 // Process SHLO message from the server. |
| 151 void DoReceiveSHLO(const CryptoHandshakeMessage* in, |
| 152 QuicCryptoClientConfig::CachedState* cached); |
| 153 |
122 // Start the proof verification if |server_id_| is https and |cached| has | 154 // Start the proof verification if |server_id_| is https and |cached| has |
123 // signature. | 155 // signature. |
124 void DoInitializeServerConfigUpdate( | 156 void DoInitializeServerConfigUpdate( |
125 QuicCryptoClientConfig::CachedState* cached); | 157 QuicCryptoClientConfig::CachedState* cached); |
126 | 158 |
127 // Starts the proof verification. Returns the QuicAsyncStatus returned by the | |
128 // ProofVerifier's VerifyProof. | |
129 QuicAsyncStatus DoVerifyProof(QuicCryptoClientConfig::CachedState* cached); | |
130 | |
131 // If proof is valid then it sets the proof as valid (which persists the | |
132 // server config) and returns QUIC_NO_ERROR. If not, it closes the connection | |
133 // and returns QUIC_PROOF_INVALID. | |
134 QuicErrorCode DoVerifyProofComplete( | |
135 QuicCryptoClientConfig::CachedState* cached); | |
136 | |
137 // Called to set the proof of |cached| valid. Also invokes the session's | 159 // Called to set the proof of |cached| valid. Also invokes the session's |
138 // OnProofValid() method. | 160 // OnProofValid() method. |
139 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); | 161 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); |
140 | 162 |
141 // Returns true if the server crypto config in |cached| requires a ChannelID | 163 // Returns true if the server crypto config in |cached| requires a ChannelID |
142 // and the client config settings also allow sending a ChannelID. | 164 // and the client config settings also allow sending a ChannelID. |
143 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); | 165 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); |
144 | 166 |
145 QuicClientSessionBase* client_session(); | 167 QuicClientSessionBase* client_session(); |
146 | 168 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 bool verify_ok_; | 211 bool verify_ok_; |
190 string verify_error_details_; | 212 string verify_error_details_; |
191 scoped_ptr<ProofVerifyDetails> verify_details_; | 213 scoped_ptr<ProofVerifyDetails> verify_details_; |
192 | 214 |
193 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 215 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
194 }; | 216 }; |
195 | 217 |
196 } // namespace net | 218 } // namespace net |
197 | 219 |
198 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 220 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
OLD | NEW |