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); |