Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(636)

Side by Side Diff: net/quic/p2p/quic_p2p_crypto_config.cc

Issue 1904213002: QUIC: support diversified keys with version 33. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hkdf
Patch Set: Rebase Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/crypto/quic_decrypter.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « net/quic/crypto/quic_decrypter.cc ('k') | net/quic/quic_connection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698