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_DONE, |
109 }; | 111 }; |
110 | 112 |
111 // 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 |
112 // server during a connection. | 114 // server during a connection. |
113 void HandleServerConfigUpdateMessage( | 115 void HandleServerConfigUpdateMessage( |
114 const CryptoHandshakeMessage& server_config_update); | 116 const CryptoHandshakeMessage& server_config_update); |
115 | 117 |
116 // DoHandshakeLoop performs a step of the handshake state machine. Note that | 118 // 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. | 119 // |in| may be NULL if the call did not result from a received message. |
118 void DoHandshakeLoop(const CryptoHandshakeMessage* in); | 120 void DoHandshakeLoop(const CryptoHandshakeMessage* in); |
119 | 121 |
| 122 // Start the proof verification if |server_id_| is https and |cached| has |
| 123 // signature. |
| 124 void DoInitializeServerConfigUpdate( |
| 125 QuicCryptoClientConfig::CachedState* cached); |
| 126 |
| 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 |
120 // Called to set the proof of |cached| valid. Also invokes the session's | 137 // Called to set the proof of |cached| valid. Also invokes the session's |
121 // OnProofValid() method. | 138 // OnProofValid() method. |
122 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); | 139 void SetCachedProofValid(QuicCryptoClientConfig::CachedState* cached); |
123 | 140 |
124 // Returns true if the server crypto config in |cached| requires a ChannelID | 141 // Returns true if the server crypto config in |cached| requires a ChannelID |
125 // and the client config settings also allow sending a ChannelID. | 142 // and the client config settings also allow sending a ChannelID. |
126 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); | 143 bool RequiresChannelID(QuicCryptoClientConfig::CachedState* cached); |
127 | 144 |
128 QuicClientSessionBase* client_session(); | 145 QuicClientSessionBase* client_session(); |
129 | 146 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 bool verify_ok_; | 189 bool verify_ok_; |
173 string verify_error_details_; | 190 string verify_error_details_; |
174 scoped_ptr<ProofVerifyDetails> verify_details_; | 191 scoped_ptr<ProofVerifyDetails> verify_details_; |
175 | 192 |
176 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); | 193 DISALLOW_COPY_AND_ASSIGN(QuicCryptoClientStream); |
177 }; | 194 }; |
178 | 195 |
179 } // namespace net | 196 } // namespace net |
180 | 197 |
181 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ | 198 #endif // NET_QUIC_QUIC_CRYPTO_CLIENT_STREAM_H_ |
OLD | NEW |