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 #include "net/quic/quic_crypto_client_stream.h" | 5 #include "net/quic/quic_crypto_client_stream.h" |
6 | 6 |
7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
8 #include "net/quic/crypto/crypto_protocol.h" | 8 #include "net/quic/crypto/crypto_protocol.h" |
9 #include "net/quic/crypto/crypto_utils.h" | 9 #include "net/quic/crypto/crypto_utils.h" |
10 #include "net/quic/crypto/null_encrypter.h" | 10 #include "net/quic/crypto/null_encrypter.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 do { | 185 do { |
186 CHECK_NE(STATE_NONE, next_state_); | 186 CHECK_NE(STATE_NONE, next_state_); |
187 const State state = next_state_; | 187 const State state = next_state_; |
188 next_state_ = STATE_IDLE; | 188 next_state_ = STATE_IDLE; |
189 rv = QUIC_SUCCESS; | 189 rv = QUIC_SUCCESS; |
190 switch (state) { | 190 switch (state) { |
191 case STATE_INITIALIZE: | 191 case STATE_INITIALIZE: |
192 DoInitialize(cached); | 192 DoInitialize(cached); |
193 break; | 193 break; |
194 case STATE_SEND_CHLO: | 194 case STATE_SEND_CHLO: |
195 DoSendCHLO(in, cached); | 195 DoSendCHLO(cached); |
196 return; // return waiting to hear from server. | 196 return; // return waiting to hear from server. |
197 case STATE_RECV_REJ: | 197 case STATE_RECV_REJ: |
198 DoReceiveREJ(in, cached); | 198 DoReceiveREJ(in, cached); |
199 break; | 199 break; |
200 case STATE_VERIFY_PROOF: | 200 case STATE_VERIFY_PROOF: |
201 rv = DoVerifyProof(cached); | 201 rv = DoVerifyProof(cached); |
202 break; | 202 break; |
203 case STATE_VERIFY_PROOF_COMPLETE: | 203 case STATE_VERIFY_PROOF_COMPLETE: |
204 DoVerifyProofComplete(cached); | 204 DoVerifyProofComplete(cached); |
205 break; | 205 break; |
(...skipping 29 matching lines...) Expand all Loading... |
235 // the proof. | 235 // the proof. |
236 DCHECK(crypto_config_->proof_verifier()); | 236 DCHECK(crypto_config_->proof_verifier()); |
237 // If the cached state needs to be verified, do it now. | 237 // If the cached state needs to be verified, do it now. |
238 next_state_ = STATE_VERIFY_PROOF; | 238 next_state_ = STATE_VERIFY_PROOF; |
239 } else { | 239 } else { |
240 next_state_ = STATE_GET_CHANNEL_ID; | 240 next_state_ = STATE_GET_CHANNEL_ID; |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 void QuicCryptoClientStream::DoSendCHLO( | 244 void QuicCryptoClientStream::DoSendCHLO( |
245 const CryptoHandshakeMessage* in, | |
246 QuicCryptoClientConfig::CachedState* cached) { | 245 QuicCryptoClientConfig::CachedState* cached) { |
247 if (stateless_reject_received_) { | 246 if (stateless_reject_received_) { |
248 // If we've gotten to this point, we've sent at least one hello | 247 // If we've gotten to this point, we've sent at least one hello |
249 // and received a stateless reject in response. We cannot | 248 // and received a stateless reject in response. We cannot |
250 // continue to send hellos because the server has abandoned state | 249 // continue to send hellos because the server has abandoned state |
251 // for this connection. Abandon further handshakes. | 250 // for this connection. Abandon further handshakes. |
252 next_state_ = STATE_NONE; | 251 next_state_ = STATE_NONE; |
253 if (session()->connection()->connected()) { | 252 if (session()->connection()->connected()) { |
254 session()->connection()->CloseConnection( | 253 session()->connection()->CloseConnection( |
255 QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, false); | 254 QUIC_CRYPTO_HANDSHAKE_STATELESS_REJECT, false); |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 } | 616 } |
618 } | 617 } |
619 return false; | 618 return false; |
620 } | 619 } |
621 | 620 |
622 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 621 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
623 return reinterpret_cast<QuicClientSessionBase*>(session()); | 622 return reinterpret_cast<QuicClientSessionBase*>(session()); |
624 } | 623 } |
625 | 624 |
626 } // namespace net | 625 } // namespace net |
OLD | NEW |