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

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

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/channel_id_chromium.cc
diff --git a/net/quic/crypto/channel_id_chromium.cc b/net/quic/crypto/channel_id_chromium.cc
index 53feed30630965741a8f0394c7adf4c7e3f647a0..aa430ace8752358e2e1208a1492c4626332de4f3 100644
--- a/net/quic/crypto/channel_id_chromium.cc
+++ b/net/quic/crypto/channel_id_chromium.cc
@@ -87,8 +87,7 @@ class ChannelIDSourceChromium::Job {
ChannelIDService* const channel_id_service_;
- std::string channel_id_private_key_;
- std::string channel_id_cert_;
+ scoped_ptr<crypto::ECPrivateKey> channel_id_crypto_key_;
ChannelIDService::RequestHandle channel_id_request_handle_;
// |hostname| specifies the hostname for which we need a channel ID.
@@ -178,9 +177,7 @@ int ChannelIDSourceChromium::Job::DoGetChannelIDKey(int result) {
next_state_ = STATE_GET_CHANNEL_ID_KEY_COMPLETE;
return channel_id_service_->GetOrCreateChannelID(
- hostname_,
- &channel_id_private_key_,
- &channel_id_cert_,
+ hostname_, &channel_id_crypto_key_,
base::Bind(&ChannelIDSourceChromium::Job::OnIOComplete,
base::Unretained(this)),
&channel_id_request_handle_);
@@ -193,22 +190,7 @@ int ChannelIDSourceChromium::Job::DoGetChannelIDKeyComplete(int result) {
return result;
}
- std::vector<uint8> encrypted_private_key_info(
- channel_id_private_key_.size());
- memcpy(&encrypted_private_key_info[0], channel_id_private_key_.data(),
- channel_id_private_key_.size());
-
- base::StringPiece spki_piece;
- if (!asn1::ExtractSPKIFromDERCert(channel_id_cert_, &spki_piece)) {
- return ERR_UNEXPECTED;
- }
- std::vector<uint8> subject_public_key_info(spki_piece.size());
- memcpy(&subject_public_key_info[0], spki_piece.data(), spki_piece.size());
-
- crypto::ECPrivateKey* ec_private_key =
- crypto::ECPrivateKey::CreateFromEncryptedPrivateKeyInfo(
- ChannelIDService::kEPKIPassword, encrypted_private_key_info,
- subject_public_key_info);
+ crypto::ECPrivateKey* ec_private_key = channel_id_crypto_key_.get();
if (!ec_private_key) {
// TODO(wtc): use the new error code ERR_CHANNEL_ID_IMPORT_FAILED to be
// added in https://codereview.chromium.org/338093012/.

Powered by Google App Engine
This is Rietveld 408576698