| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/p2p/quic_p2p_crypto_config.h" | 5 #include "net/quic/p2p/quic_p2p_crypto_config.h" |
| 6 | 6 |
| 7 #include "net/quic/crypto/crypto_handshake.h" | 7 #include "net/quic/crypto/crypto_handshake.h" |
| 8 #include "net/quic/crypto/crypto_utils.h" | 8 #include "net/quic/crypto/crypto_utils.h" |
| 9 | 9 |
| 10 namespace net { | 10 namespace net { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 std::string hkdf_input; | 24 std::string hkdf_input; |
| 25 const size_t label_len = strlen(QuicCryptoConfig::kForwardSecureLabel) + 1; | 25 const size_t label_len = strlen(QuicCryptoConfig::kForwardSecureLabel) + 1; |
| 26 hkdf_input.reserve(label_len + out_params->hkdf_input_suffix.size()); | 26 hkdf_input.reserve(label_len + out_params->hkdf_input_suffix.size()); |
| 27 hkdf_input.append(QuicCryptoConfig::kForwardSecureLabel, label_len); | 27 hkdf_input.append(QuicCryptoConfig::kForwardSecureLabel, label_len); |
| 28 hkdf_input.append(out_params->hkdf_input_suffix); | 28 hkdf_input.append(out_params->hkdf_input_suffix); |
| 29 | 29 |
| 30 if (!CryptoUtils::DeriveKeys( | 30 if (!CryptoUtils::DeriveKeys( |
| 31 out_params->forward_secure_premaster_secret, out_params->aead, | 31 out_params->forward_secure_premaster_secret, out_params->aead, |
| 32 out_params->client_nonce, out_params->server_nonce, hkdf_input, | 32 out_params->client_nonce, out_params->server_nonce, hkdf_input, |
| 33 perspective, &out_params->forward_secure_crypters, | 33 perspective, CryptoUtils::Diversification::Never(), |
| 34 &out_params->subkey_secret)) { | 34 &out_params->forward_secure_crypters, &out_params->subkey_secret)) { |
| 35 return false; | 35 return false; |
| 36 } | 36 } |
| 37 | 37 |
| 38 return true; | 38 return true; |
| 39 } | 39 } |
| 40 | 40 |
| 41 } // namespace net | 41 } // namespace net |
| OLD | NEW |