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

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

Issue 300223007: Break ChannelIDSigner into two classes: ChannelIDKey and ChannelIDSource. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed copy-and-paste error Created 6 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 side-by-side diff with in-line comments
Download patch
Index: net/quic/crypto/quic_crypto_client_config.cc
diff --git a/net/quic/crypto/quic_crypto_client_config.cc b/net/quic/crypto/quic_crypto_client_config.cc
index 9347493082d6e52d06e467d7dc8e3cfff2dad391..f9b31fd57b5e73e0203ce1ef4512b4d6fd1618b0 100644
--- a/net/quic/crypto/quic_crypto_client_config.cc
+++ b/net/quic/crypto/quic_crypto_client_config.cc
@@ -444,7 +444,7 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
out->SetStringPiece(kPUBS, out_params->client_key_exchange->public_value());
bool do_channel_id = false;
- if (channel_id_signer_.get()) {
+ if (channel_id_source_.get()) {
const QuicTag* their_proof_demands;
size_t num_their_proof_demands;
if (scfg->GetTaglist(kPDMD, &their_proof_demands,
@@ -478,9 +478,15 @@ QuicErrorCode QuicCryptoClientConfig::FillClientHello(
client_hello_serialized.length());
hkdf_input.append(cached->server_config());
- string key, signature;
- if (!channel_id_signer_->Sign(server_id.host(), hkdf_input,
- &key, &signature)) {
+ 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)) {
*error_details = "Channel ID signature failed";
return QUIC_INVALID_CHANNEL_ID_SIGNATURE;
}
@@ -683,12 +689,12 @@ void QuicCryptoClientConfig::SetProofVerifier(ProofVerifier* verifier) {
proof_verifier_.reset(verifier);
}
-ChannelIDSigner* QuicCryptoClientConfig::channel_id_signer() const {
- return channel_id_signer_.get();
+ChannelIDSource* QuicCryptoClientConfig::channel_id_source() const {
+ return channel_id_source_.get();
}
-void QuicCryptoClientConfig::SetChannelIDSigner(ChannelIDSigner* signer) {
- channel_id_signer_.reset(signer);
+void QuicCryptoClientConfig::SetChannelIDSource(ChannelIDSource* source) {
+ channel_id_source_.reset(source);
}
void QuicCryptoClientConfig::InitializeFrom(

Powered by Google App Engine
This is Rietveld 408576698