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

Unified Diff: chrome/browser/extensions/api/messaging/message_property_provider.cc

Issue 1076063002: Remove certificates from Channel ID (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix some small style/formatting issues 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
« no previous file with comments | « no previous file | net/cert/x509_util.h » ('j') | net/cert/x509_util_nss.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/messaging/message_property_provider.cc
diff --git a/chrome/browser/extensions/api/messaging/message_property_provider.cc b/chrome/browser/extensions/api/messaging/message_property_provider.cc
index c57bb165cbd314492266a5fb42254a7121a9fc32..d64f5d4534b9bbc156d1d00ad86d324c56423c49 100644
--- a/chrome/browser/extensions/api/messaging/message_property_provider.cc
+++ b/chrome/browser/extensions/api/messaging/message_property_provider.cc
@@ -46,8 +46,7 @@ void MessagePropertyProvider::GetChannelID(Profile* profile,
// ChannelIDService::GetChannelID to the callback provided to
// MessagePropertyProvider::GetChannelID.
struct MessagePropertyProvider::GetChannelIDOutput {
- std::string domain_bound_private_key;
- std::string domain_bound_cert;
+ scoped_ptr<crypto::ECPrivateKey> channel_id_key;
net::ChannelIDService::RequestHandle request_handle;
};
@@ -67,12 +66,9 @@ void MessagePropertyProvider::GetChannelIDOnIOThread(
original_task_runner,
base::Owned(output),
reply);
- int status = channel_id_service->GetChannelID(
- host,
- &output->domain_bound_private_key,
- &output->domain_bound_cert,
- net_completion_callback,
- &output->request_handle);
+ int status = channel_id_service->GetChannelID(host, &output->channel_id_key,
+ net_completion_callback,
+ &output->request_handle);
if (status == net::ERR_IO_PENDING)
return;
GotChannelID(original_task_runner, output, reply, status);
@@ -89,11 +85,13 @@ void MessagePropertyProvider::GotChannelID(
original_task_runner->PostTask(FROM_HERE, no_tls_channel_id_closure);
return;
}
- base::StringPiece spki;
- if (!net::asn1::ExtractSPKIFromDERCert(output->domain_bound_cert, &spki)) {
+ std::vector<uint8> spki_vector;
+ if (!output->channel_id_key->ExportPublicKey(&spki_vector)) {
original_task_runner->PostTask(FROM_HERE, no_tls_channel_id_closure);
return;
}
+ base::StringPiece spki(reinterpret_cast<char*>(&spki_vector[0]),
Ryan Sleevi 2015/04/15 22:50:02 vector_as_array<> is far safer for this (see base/
nharper 2015/04/25 02:59:19 Done.
+ spki_vector.size());
base::DictionaryValue jwk_value;
if (!net::JwkSerializer::ConvertSpkiFromDerToJwk(spki, &jwk_value)) {
original_task_runner->PostTask(FROM_HERE, no_tls_channel_id_closure);
« no previous file with comments | « no previous file | net/cert/x509_util.h » ('j') | net/cert/x509_util_nss.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698