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

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

Issue 1715593002: QUIC: obtain source address token keys from internal key server. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@114217654
Patch Set: Created 4 years, 10 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_server_config.h ('k') | net/quic/crypto/quic_crypto_server_config_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 db545f9c9b416cc8c10d4620bac3f213fc015f8d..a96943fc7660c71cf81a9fb04dbcda9a77ce9fcb 100644
--- a/net/quic/crypto/quic_crypto_server_config.cc
+++ b/net/quic/crypto/quic_crypto_server_config.cc
@@ -225,8 +225,8 @@ QuicCryptoServerConfig::QuicCryptoServerConfig(
server_nonce_strike_register_window_secs_(120),
enable_serving_sct_(false) {
DCHECK(proof_source_.get());
- default_source_address_token_boxer_.SetKey(
- DeriveSourceAddressTokenKey(source_address_token_secret));
+ default_source_address_token_boxer_.SetKeys(
+ {DeriveSourceAddressTokenKey(source_address_token_secret)});
// Generate a random key and orbit for server nonces.
server_nonce_entropy->RandBytes(server_nonce_orbit_,
@@ -235,8 +235,8 @@ QuicCryptoServerConfig::QuicCryptoServerConfig(
scoped_ptr<uint8_t[]> key_bytes(new uint8_t[key_size]);
server_nonce_entropy->RandBytes(key_bytes.get(), key_size);
- server_nonce_boxer_.SetKey(
- StringPiece(reinterpret_cast<char*>(key_bytes.get()), key_size));
+ server_nonce_boxer_.SetKeys(
+ {string(reinterpret_cast<char*>(key_bytes.get()), key_size)});
}
QuicCryptoServerConfig::~QuicCryptoServerConfig() {
@@ -480,6 +480,11 @@ bool QuicCryptoServerConfig::SetConfigs(
return ok;
}
+void QuicCryptoServerConfig::SetDefaultSourceAddressTokenKeys(
+ const vector<string>& keys) {
+ default_source_address_token_boxer_.SetKeys(keys);
+}
+
void QuicCryptoServerConfig::GetConfigIds(vector<string>* scids) const {
base::AutoLock locked(configs_lock_);
for (ConfigMap::const_iterator it = configs_.begin(); it != configs_.end();
@@ -1335,8 +1340,8 @@ QuicCryptoServerConfig::ParseConfigProtobuf(
} else {
// Create override boxer instance.
CryptoSecretBoxer* boxer = new CryptoSecretBoxer;
- boxer->SetKey(DeriveSourceAddressTokenKey(
- protobuf->source_address_token_secret_override()));
+ boxer->SetKeys({DeriveSourceAddressTokenKey(
+ protobuf->source_address_token_secret_override())});
config->source_address_token_boxer_storage.reset(boxer);
config->source_address_token_boxer = boxer;
}
« no previous file with comments | « net/quic/crypto/quic_crypto_server_config.h ('k') | net/quic/crypto/quic_crypto_server_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698