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

Unified Diff: net/quic/crypto/quic_crypto_server_config.cc

Issue 1009543004: Create a Perspective enum to use instead of a bool is_server to improve (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added NET_EXPORT_PRIVATE to fix compiler error Created 5 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/crypto/quic_crypto_server_config.cc
diff --git a/net/quic/crypto/quic_crypto_server_config.cc b/net/quic/crypto/quic_crypto_server_config.cc
index c324db2a8a4eaa1ba4400f4c48deb6f0e68d00f4..557435d108562a8519cf20ba4b9346a6e05b4a6a 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -679,7 +679,7 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
CrypterPair crypters;
if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
info.client_nonce, info.server_nonce,
- hkdf_input, CryptoUtils::SERVER, &crypters,
+ hkdf_input, Perspective::IS_SERVER, &crypters,
nullptr /* subkey secret */)) {
*error_details = "Symmetric key setup failed";
return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
@@ -719,11 +719,10 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
hkdf_input.append(QuicCryptoConfig::kInitialLabel, label_len);
hkdf_input.append(hkdf_suffix);
- if (!CryptoUtils::DeriveKeys(params->initial_premaster_secret, params->aead,
- info.client_nonce, info.server_nonce, hkdf_input,
- CryptoUtils::SERVER,
- &params->initial_crypters,
- nullptr /* subkey secret */)) {
+ if (!CryptoUtils::DeriveKeys(
+ params->initial_premaster_secret, params->aead, info.client_nonce,
+ info.server_nonce, hkdf_input, Perspective::IS_SERVER,
+ &params->initial_crypters, nullptr /* subkey secret */)) {
*error_details = "Symmetric key setup failed";
return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
}
@@ -754,10 +753,10 @@ QuicErrorCode QuicCryptoServerConfig::ProcessClientHello(
forward_secure_hkdf_input.append(hkdf_suffix);
if (!CryptoUtils::DeriveKeys(
- params->forward_secure_premaster_secret, params->aead,
- info.client_nonce, info.server_nonce, forward_secure_hkdf_input,
- CryptoUtils::SERVER, &params->forward_secure_crypters,
- &params->subkey_secret)) {
+ params->forward_secure_premaster_secret, params->aead,
+ info.client_nonce, info.server_nonce, forward_secure_hkdf_input,
+ Perspective::IS_SERVER, &params->forward_secure_crypters,
+ &params->subkey_secret)) {
*error_details = "Symmetric key setup failed";
return QUIC_CRYPTO_SYMMETRIC_KEY_SETUP_FAILED;
}
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.cc ('k') | net/quic/quic_client_session_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698