Chromium Code Reviews| 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_DONE, |
| 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); | |
|
ramant (doing other things)
2014/09/19 03:13:07
Hi Ryan and Adam,
Added crude comments. Would ap
Ryan Hamilton
2014/09/24 15:36:47
These seem fine. We often don't even comment our v
| |
| 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( | |
| 136 QuicCryptoClientConfig::CachedState* cached); | |
| 137 | |
| 138 // If proof is valid then it sets the proof as valid (which persists the | |
| 139 // server config). If not, it closes the connection. | |
| 140 void DoVerifyProofComplete(QuicCryptoClientConfig::CachedState* cached); | |
| 141 | |
| 142 // Start the look up of Channel ID process. Returns either QUIC_SUCCESS if | |
| 143 // RequiresChannelID returns false or QuicAsyncStatus returned by | |
| 144 // GetChannelIDKey. | |
| 145 QuicAsyncStatus DoGetChannelID(QuicCryptoClientConfig::CachedState* cached); | |
| 146 | |
| 147 // If there is no channel ID, then close the connection otherwise transtion to | |
| 148 // STATE_SEND_CHLO state. | |
| 149 void DoGetChannelIDComplete(); | |
| 150 | |
| 151 // Process SHLO message from the server. | |
| 152 void DoReceiveSHLO(const CryptoHandshakeMessage* in, | |
| 153 QuicCryptoClientConfig::CachedState* cached); | |
| 154 | |
| 122 // Start the proof verification if |server_id_| is https and |cached| has | 155 // Start the proof verification if |server_id_| is https and |cached| has |
| 123 // signature. | 156 // signature. |
| 124 void DoInitializeServerConfigUpdate( | 157 void DoInitializeServerConfigUpdate( |
| 125 QuicCryptoClientConfig::CachedState* cached); | 158 QuicCryptoClientConfig::CachedState* cached); |
| 126 | 159 |
| 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 | 160 // Called to set the proof of |cached| valid. Also invokes the session's |
| 138 // OnProofValid() method. | 161 // OnProofValid() method. |
| 139 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); | 162 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); |
| 140 | 163 |
| 141 // Returns true if the server crypto config in |cached| requires a ChannelID | 164 // Returns true if the server crypto config in |cached| requires a ChannelID |
| 142 // and the client config settings also allow sending a ChannelID. | 165 // and the client config settings also allow sending a ChannelID. |
| 143 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); | 166 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); |
| 144 | 167 |
| 145 QuicClientSessionBase* client_session(); | 168 QuicClientSessionBase* client_session(); |
| 146 | 169 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 bool verify_ok_; | 212 bool verify_ok_; |
| 190 string verify_error_details_; | 213 string verify_error_details_; |
| 191 scoped_ptr<ProofVerifyDetails> verify_details_; | 214 scoped_ptr<ProofVerifyDetails> verify_details_; |
| 192 | 215 |
| 193 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 216 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
| 194 }; | 217 }; |
| 195 | 218 |
| 196 } // namespace net | 219 } // namespace net |
| 197 | 220 |
| 198 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 221 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
| OLD | NEW |