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

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

Issue 320663002: Change the prototype of ChannelIDSource::GetChannelIDKey() to allow an (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove unrelated changes Created 6 years, 6 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.h ('k') | net/quic/crypto/quic_crypto_client_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_client_config.cc
===================================================================
--- net/quic/crypto/quic_crypto_client_config.cc (revision 275522)
+++ net/quic/crypto/quic_crypto_client_config.cc (working copy)
@@ -350,6 +350,7 @@
const CachedState* cached,
QuicWallTime now,
QuicRandom* rand,
+ const ChannelIDKey* channel_id_key,
QuicCryptoNegotiatedParameters* out_params,
CryptoHandshakeMessage* out,
string* error_details) const {
@@ -447,22 +448,7 @@
}
out->SetStringPiece(kPUBS, out_params->client_key_exchange->public_value());
- bool do_channel_id = false;
- if (channel_id_source_.get()) {
- const QuicTag* their_proof_demands;
- size_t num_their_proof_demands;
- if (scfg->GetTaglist(kPDMD, &their_proof_demands,
- &num_their_proof_demands) == QUIC_NO_ERROR) {
- for (size_t i = 0; i < num_their_proof_demands; i++) {
- if (their_proof_demands[i] == kCHID) {
- do_channel_id = true;
- break;
- }
- }
- }
- }
-
- if (do_channel_id) {
+ if (channel_id_key) {
// In order to calculate the encryption key for the CETV block we need to
// serialise the client hello as it currently is (i.e. without the CETV
// block). For this, the client hello is serialized without padding.
@@ -482,12 +468,6 @@
client_hello_serialized.length());
hkdf_input.append(cached->server_config());
- scoped_ptr<ChannelIDKey> channel_id_key;
- if (!channel_id_source_->GetChannelIDKey(server_id.host(),
- &channel_id_key)) {
- *error_details = "Channel ID lookup failed";
- return QUIC_INVALID_CHANNEL_ID_SIGNATURE;
- }
string key = channel_id_key->SerializeKey();
string signature;
if (!channel_id_key->Sign(hkdf_input, &signature)) {
@@ -523,6 +503,10 @@
out->set_minimum_size(orig_min_size);
}
+ // Derive the symmetric keys and set up the encrypters and decrypters.
+ // Set the following members of out_params:
+ // out_params->hkdf_input_suffix
+ // out_params->initial_crypters
out_params->hkdf_input_suffix.clear();
out_params->hkdf_input_suffix.append(reinterpret_cast<char*>(&connection_id),
sizeof(connection_id));
« no previous file with comments | « net/quic/crypto/quic_crypto_client_config.h ('k') | net/quic/crypto/quic_crypto_client_config_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698