| 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.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/profiler/scoped_tracker.h" | 8 #include "base/profiler/scoped_tracker.h" |
| 9 #include "net/quic/crypto/crypto_protocol.h" | 9 #include "net/quic/crypto/crypto_protocol.h" |
| 10 #include "net/quic/crypto/crypto_utils.h" | 10 #include "net/quic/crypto/crypto_utils.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 CHECK_NE(STATE_NONE, next_state_); | 189 CHECK_NE(STATE_NONE, next_state_); |
| 190 const State state = next_state_; | 190 const State state = next_state_; |
| 191 next_state_ = STATE_IDLE; | 191 next_state_ = STATE_IDLE; |
| 192 rv = QUIC_SUCCESS; | 192 rv = QUIC_SUCCESS; |
| 193 switch (state) { | 193 switch (state) { |
| 194 case STATE_INITIALIZE: | 194 case STATE_INITIALIZE: |
| 195 DoInitialize(cached); | 195 DoInitialize(cached); |
| 196 break; | 196 break; |
| 197 case STATE_SEND_CHLO: | 197 case STATE_SEND_CHLO: |
| 198 DoSendCHLO(in, cached); | 198 DoSendCHLO(in, cached); |
| 199 return; | 199 return; // return waiting to hear from server. |
| 200 case STATE_RECV_REJ: | 200 case STATE_RECV_REJ: |
| 201 DoReceiveREJ(in, cached); | 201 DoReceiveREJ(in, cached); |
| 202 break; | 202 break; |
| 203 case STATE_VERIFY_PROOF: | 203 case STATE_VERIFY_PROOF: |
| 204 rv = DoVerifyProof(cached); | 204 rv = DoVerifyProof(cached); |
| 205 break; | 205 break; |
| 206 case STATE_VERIFY_PROOF_COMPLETE: | 206 case STATE_VERIFY_PROOF_COMPLETE: |
| 207 DoVerifyProofComplete(cached); | 207 DoVerifyProofComplete(cached); |
| 208 break; | 208 break; |
| 209 case STATE_GET_CHANNEL_ID: | 209 case STATE_GET_CHANNEL_ID: |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 631 } | 631 } |
| 632 | 632 |
| 633 bool QuicCryptoClientStream::RequiresChannelID( | 633 bool QuicCryptoClientStream::RequiresChannelID( |
| 634 QuicCryptoClientConfig::CachedState* cached) { | 634 QuicCryptoClientConfig::CachedState* cached) { |
| 635 if (!server_id_.is_https() || | 635 if (!server_id_.is_https() || |
| 636 server_id_.privacy_mode() == PRIVACY_MODE_ENABLED || | 636 server_id_.privacy_mode() == PRIVACY_MODE_ENABLED || |
| 637 !crypto_config_->channel_id_source()) { | 637 !crypto_config_->channel_id_source()) { |
| 638 return false; | 638 return false; |
| 639 } | 639 } |
| 640 const CryptoHandshakeMessage* scfg = cached->GetServerConfig(); | 640 const CryptoHandshakeMessage* scfg = cached->GetServerConfig(); |
| 641 if (!scfg) { // scfg may be null when we send an inchoate CHLO. | 641 if (!scfg) { // scfg may be null then we send an inchoate CHLO. |
| 642 return false; | 642 return false; |
| 643 } | 643 } |
| 644 const QuicTag* their_proof_demands; | 644 const QuicTag* their_proof_demands; |
| 645 size_t num_their_proof_demands; | 645 size_t num_their_proof_demands; |
| 646 if (scfg->GetTaglist(kPDMD, &their_proof_demands, | 646 if (scfg->GetTaglist(kPDMD, &their_proof_demands, |
| 647 &num_their_proof_demands) != QUIC_NO_ERROR) { | 647 &num_their_proof_demands) != QUIC_NO_ERROR) { |
| 648 return false; | 648 return false; |
| 649 } | 649 } |
| 650 for (size_t i = 0; i < num_their_proof_demands; i++) { | 650 for (size_t i = 0; i < num_their_proof_demands; i++) { |
| 651 if (their_proof_demands[i] == kCHID) { | 651 if (their_proof_demands[i] == kCHID) { |
| 652 return true; | 652 return true; |
| 653 } | 653 } |
| 654 } | 654 } |
| 655 return false; | 655 return false; |
| 656 } | 656 } |
| 657 | 657 |
| 658 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 658 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
| 659 return reinterpret_cast<QuicClientSessionBase*>(session()); | 659 return reinterpret_cast<QuicClientSessionBase*>(session()); |
| 660 } | 660 } |
| 661 | 661 |
| 662 } // namespace net | 662 } // namespace net |
| OLD | NEW |