| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/quic_crypto_client_config.h" | 5 #include "net/quic/crypto/quic_crypto_client_config.h" |
| 6 | 6 |
| 7 #include "base/metrics/sparse_histogram.h" | 7 #include "base/metrics/sparse_histogram.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/quic/crypto/cert_compressor.h" | 10 #include "net/quic/crypto/cert_compressor.h" |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 696 out_params->forward_secure_premaster_secret, out_params->aead, | 696 out_params->forward_secure_premaster_secret, out_params->aead, |
| 697 out_params->client_nonce, out_params->server_nonce, hkdf_input, | 697 out_params->client_nonce, out_params->server_nonce, hkdf_input, |
| 698 CryptoUtils::CLIENT, &out_params->forward_secure_crypters)) { | 698 CryptoUtils::CLIENT, &out_params->forward_secure_crypters)) { |
| 699 *error_details = "Symmetric key setup failed"; | 699 *error_details = "Symmetric key setup failed"; |
| 700 return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED; | 700 return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED; |
| 701 } | 701 } |
| 702 | 702 |
| 703 return QUIC_NO_ERROR; | 703 return QUIC_NO_ERROR; |
| 704 } | 704 } |
| 705 | 705 |
| 706 QuicErrorCode QuicCryptoClientConfig::ProcessServerConfigUpdate( |
| 707 const CryptoHandshakeMessage& server_config_update, |
| 708 QuicWallTime now, |
| 709 CachedState* cached, |
| 710 QuicCryptoNegotiatedParameters* out_params, |
| 711 string* error_details) { |
| 712 DCHECK(error_details != NULL); |
| 713 |
| 714 if (server_config_update.tag() != kSCUP) { |
| 715 *error_details = "ServerConfigUpdate must have kSCUP tag."; |
| 716 return QUIC_INVALID_CRYPTO_MESSAGE_TYPE; |
| 717 } |
| 718 |
| 719 return CacheNewServerConfig(server_config_update, now, cached, out_params, |
| 720 error_details); |
| 721 } |
| 722 |
| 706 ProofVerifier* QuicCryptoClientConfig::proof_verifier() const { | 723 ProofVerifier* QuicCryptoClientConfig::proof_verifier() const { |
| 707 return proof_verifier_.get(); | 724 return proof_verifier_.get(); |
| 708 } | 725 } |
| 709 | 726 |
| 710 void QuicCryptoClientConfig::SetProofVerifier(ProofVerifier* verifier) { | 727 void QuicCryptoClientConfig::SetProofVerifier(ProofVerifier* verifier) { |
| 711 proof_verifier_.reset(verifier); | 728 proof_verifier_.reset(verifier); |
| 712 } | 729 } |
| 713 | 730 |
| 714 ChannelIDSource* QuicCryptoClientConfig::channel_id_source() const { | 731 ChannelIDSource* QuicCryptoClientConfig::channel_id_source() const { |
| 715 return channel_id_source_.get(); | 732 return channel_id_source_.get(); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 782 return; | 799 return; |
| 783 } | 800 } |
| 784 | 801 |
| 785 // Update canonical version to point at the "most recent" entry. | 802 // Update canonical version to point at the "most recent" entry. |
| 786 canonical_server_map_[suffix_server_id] = server_id; | 803 canonical_server_map_[suffix_server_id] = server_id; |
| 787 | 804 |
| 788 server_state->InitializeFrom(*canonical_state); | 805 server_state->InitializeFrom(*canonical_state); |
| 789 } | 806 } |
| 790 | 807 |
| 791 } // namespace net | 808 } // namespace net |
| OLD | NEW |