| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/crypto/crypto_handshake.h" | 5 #include "net/quic/crypto/crypto_handshake.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 if (!has_changed) { | 463 if (!has_changed) { |
| 464 return; | 464 return; |
| 465 } | 465 } |
| 466 | 466 |
| 467 // If the proof has changed then it needs to be revalidated. | 467 // If the proof has changed then it needs to be revalidated. |
| 468 SetProofInvalid(); | 468 SetProofInvalid(); |
| 469 certs_ = certs; | 469 certs_ = certs; |
| 470 server_config_sig_ = signature.as_string(); | 470 server_config_sig_ = signature.as_string(); |
| 471 } | 471 } |
| 472 | 472 |
| 473 void QuicCryptoClientConfig::CachedState::ClearProof() { |
| 474 SetProofInvalid(); |
| 475 certs_.clear(); |
| 476 server_config_sig_.clear(); |
| 477 } |
| 478 |
| 473 void QuicCryptoClientConfig::CachedState::SetProofValid() { | 479 void QuicCryptoClientConfig::CachedState::SetProofValid() { |
| 474 server_config_valid_ = true; | 480 server_config_valid_ = true; |
| 475 } | 481 } |
| 476 | 482 |
| 477 void QuicCryptoClientConfig::CachedState::SetProofInvalid() { | 483 void QuicCryptoClientConfig::CachedState::SetProofInvalid() { |
| 478 server_config_valid_ = false; | 484 server_config_valid_ = false; |
| 479 ++generation_counter_; | 485 ++generation_counter_; |
| 480 } | 486 } |
| 481 | 487 |
| 482 const string& QuicCryptoClientConfig::CachedState::server_config() const { | 488 const string& QuicCryptoClientConfig::CachedState::server_config() const { |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 825 if (rej.GetStringPiece(kPROF, &proof) && | 831 if (rej.GetStringPiece(kPROF, &proof) && |
| 826 rej.GetStringPiece(kCertificateTag, &cert_bytes)) { | 832 rej.GetStringPiece(kCertificateTag, &cert_bytes)) { |
| 827 vector<string> certs; | 833 vector<string> certs; |
| 828 if (!CertCompressor::DecompressChain(cert_bytes, out_params->cached_certs, | 834 if (!CertCompressor::DecompressChain(cert_bytes, out_params->cached_certs, |
| 829 common_cert_sets, &certs)) { | 835 common_cert_sets, &certs)) { |
| 830 *error_details = "Certificate data invalid"; | 836 *error_details = "Certificate data invalid"; |
| 831 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; | 837 return QUIC_INVALID_CRYPTO_MESSAGE_PARAMETER; |
| 832 } | 838 } |
| 833 | 839 |
| 834 cached->SetProof(certs, proof); | 840 cached->SetProof(certs, proof); |
| 841 } else { |
| 842 cached->ClearProof(); |
| 835 } | 843 } |
| 836 | 844 |
| 837 return QUIC_NO_ERROR; | 845 return QUIC_NO_ERROR; |
| 838 } | 846 } |
| 839 | 847 |
| 840 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( | 848 QuicErrorCode QuicCryptoClientConfig::ProcessServerHello( |
| 841 const CryptoHandshakeMessage& server_hello, | 849 const CryptoHandshakeMessage& server_hello, |
| 842 QuicGuid guid, | 850 QuicGuid guid, |
| 843 QuicCryptoNegotiatedParameters* out_params, | 851 QuicCryptoNegotiatedParameters* out_params, |
| 844 string* error_details) { | 852 string* error_details) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 | 896 |
| 889 ChannelIDSigner* QuicCryptoClientConfig::channel_id_signer() const { | 897 ChannelIDSigner* QuicCryptoClientConfig::channel_id_signer() const { |
| 890 return channel_id_signer_.get(); | 898 return channel_id_signer_.get(); |
| 891 } | 899 } |
| 892 | 900 |
| 893 void QuicCryptoClientConfig::SetChannelIDSigner(ChannelIDSigner* signer) { | 901 void QuicCryptoClientConfig::SetChannelIDSigner(ChannelIDSigner* signer) { |
| 894 channel_id_signer_.reset(signer); | 902 channel_id_signer_.reset(signer); |
| 895 } | 903 } |
| 896 | 904 |
| 897 } // namespace net | 905 } // namespace net |
| OLD | NEW |