| 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/.
|
|
|