| 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 "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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 DoInitializeServerConfigUpdate(cached); | 441 DoInitializeServerConfigUpdate(cached); |
| 442 break; | 442 break; |
| 443 case STATE_VERIFY_PROOF_DONE: | 443 case STATE_VERIFY_PROOF_DONE: |
| 444 return; // We are done. | 444 return; // We are done. |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 | 448 |
| 449 void QuicCryptoClientStream::DoInitializeServerConfigUpdate( | 449 void QuicCryptoClientStream::DoInitializeServerConfigUpdate( |
| 450 QuicCryptoClientConfig::CachedState* cached) { | 450 QuicCryptoClientConfig::CachedState* cached) { |
| 451 bool update_ignored = false; |
| 451 if (!server_id_.is_https()) { | 452 if (!server_id_.is_https()) { |
| 452 // We don't check the certificates for insecure QUIC connections. | 453 // We don't check the certificates for insecure QUIC connections. |
| 453 SetCachedProofValid(cached); | 454 SetCachedProofValid(cached); |
| 454 next_state_ = STATE_VERIFY_PROOF_DONE; | 455 next_state_ = STATE_VERIFY_PROOF_DONE; |
| 455 return; | 456 } else if (!cached->IsEmpty() && !cached->signature().empty()) { |
| 456 } | |
| 457 if (!cached->IsEmpty() && !cached->signature().empty()) { | |
| 458 // Note that we verify the proof even if the cached proof is valid. | 457 // Note that we verify the proof even if the cached proof is valid. |
| 459 DCHECK(crypto_config_->proof_verifier()); | 458 DCHECK(crypto_config_->proof_verifier()); |
| 460 next_state_ = STATE_VERIFY_PROOF; | 459 next_state_ = STATE_VERIFY_PROOF; |
| 460 } else { |
| 461 update_ignored = true; |
| 462 next_state_ = STATE_VERIFY_PROOF_DONE; |
| 461 } | 463 } |
| 464 UMA_HISTOGRAM_BOOLEAN("Net.QuicNumServerConfig.UpdateMessagesIgnored", |
| 465 update_ignored); |
| 462 } | 466 } |
| 463 | 467 |
| 464 QuicAsyncStatus QuicCryptoClientStream::DoVerifyProof( | 468 QuicAsyncStatus QuicCryptoClientStream::DoVerifyProof( |
| 465 QuicCryptoClientConfig::CachedState* cached) { | 469 QuicCryptoClientConfig::CachedState* cached) { |
| 466 ProofVerifier* verifier = crypto_config_->proof_verifier(); | 470 ProofVerifier* verifier = crypto_config_->proof_verifier(); |
| 467 DCHECK(verifier); | 471 DCHECK(verifier); |
| 468 next_state_ = STATE_VERIFY_PROOF_COMPLETE; | 472 next_state_ = STATE_VERIFY_PROOF_COMPLETE; |
| 469 generation_counter_ = cached->generation_counter(); | 473 generation_counter_ = cached->generation_counter(); |
| 470 | 474 |
| 471 ProofVerifierCallbackImpl* proof_verify_callback = | 475 ProofVerifierCallbackImpl* proof_verify_callback = |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 555 } | 559 } |
| 556 } | 560 } |
| 557 return false; | 561 return false; |
| 558 } | 562 } |
| 559 | 563 |
| 560 QuicClientSessionBase* QuicCryptoClientStream::client_session() { | 564 QuicClientSessionBase* QuicCryptoClientStream::client_session() { |
| 561 return reinterpret_cast<QuicClientSessionBase*>(session()); | 565 return reinterpret_cast<QuicClientSessionBase*>(session()); |
| 562 } | 566 } |
| 563 | 567 |
| 564 } // namespace net | 568 } // namespace net |
| OLD | NEW |