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/core/crypto/quic_crypto_server_config.h" | 5 #include "net/quic/core/crypto/quic_crypto_server_config.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
788 string hkdf_input; | 788 string hkdf_input; |
789 size_t label_len = strlen(QuicCryptoConfig::kInitialLabel) + 1; | 789 size_t label_len = strlen(QuicCryptoConfig::kInitialLabel) + 1; |
790 hkdf_input.reserve(label_len + hkdf_suffix.size()); | 790 hkdf_input.reserve(label_len + hkdf_suffix.size()); |
791 hkdf_input.append(QuicCryptoConfig::kInitialLabel, label_len); | 791 hkdf_input.append(QuicCryptoConfig::kInitialLabel, label_len); |
792 hkdf_input.append(hkdf_suffix); | 792 hkdf_input.append(hkdf_suffix); |
793 | 793 |
794 string* subkey_secret = ¶ms->initial_subkey_secret; | 794 string* subkey_secret = ¶ms->initial_subkey_secret; |
795 CryptoUtils::Diversification diversification = | 795 CryptoUtils::Diversification diversification = |
796 CryptoUtils::Diversification::Never(); | 796 CryptoUtils::Diversification::Never(); |
797 if (version > QUIC_VERSION_32) { | 797 if (version > QUIC_VERSION_32) { |
798 rand->RandBytes(reinterpret_cast<char*>(out_diversification_nonce), | 798 rand->RandBytes(out_diversification_nonce->data(), |
799 sizeof(*out_diversification_nonce)); | 799 out_diversification_nonce->size()); |
800 diversification = | 800 diversification = |
801 CryptoUtils::Diversification::Now(out_diversification_nonce); | 801 CryptoUtils::Diversification::Now(out_diversification_nonce); |
802 } | 802 } |
803 | 803 |
804 if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead, | 804 if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead, |
805 info.client_nonce, info.server_nonce, hkdf_input, | 805 info.client_nonce, info.server_nonce, hkdf_input, |
806 Perspective::IS_SERVER, diversification, | 806 Perspective::IS_SERVER, diversification, |
807 ¶ms->initial_crypters, subkey_secret)) { | 807 ¶ms->initial_crypters, subkey_secret)) { |
808 *error_details = "Symmetric key setup failed"; | 808 *error_details = "Symmetric key setup failed"; |
809 return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED; | 809 return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED; |
(...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2068 priority(0), | 2068 priority(0), |
2069 source_address_token_boxer(nullptr) {} | 2069 source_address_token_boxer(nullptr) {} |
2070 | 2070 |
2071 QuicCryptoServerConfig::Config::~Config() { | 2071 QuicCryptoServerConfig::Config::~Config() { |
2072 base::STLDeleteElements(&key_exchanges); | 2072 base::STLDeleteElements(&key_exchanges); |
2073 } | 2073 } |
2074 | 2074 |
2075 QuicCryptoProof::QuicCryptoProof() {} | 2075 QuicCryptoProof::QuicCryptoProof() {} |
2076 QuicCryptoProof::~QuicCryptoProof() {} | 2076 QuicCryptoProof::~QuicCryptoProof() {} |
2077 } // namespace net | 2077 } // namespace net |
OLD | NEW |