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

Unified Diff: chrome/browser/extensions/api/platform_keys/platform_keys_api.cc

Issue 905523002: platformKeys: Add per-extension sign permissions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pks_sign_task
Patch Set: Addressed comment. Created 5 years, 10 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: chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
diff --git a/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc b/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
index f3ad6512ad43ee63c580ecb2339f387a0db9effe..6f1fecbbcac569fdfa520112a1451143d5b38745 100644
--- a/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
+++ b/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
@@ -114,9 +114,10 @@ PlatformKeysInternalGetPublicKeyFunction::Run() {
return RespondNow(Error(kErrorInvalidX509Cert));
PublicKeyInfo key_info;
- if (!chromeos::platform_keys::GetPublicKey(
- cert_x509, &key_info.public_key_spki_der, &key_info.key_type,
- &key_info.key_size_bits) ||
+ key_info.public_key_spki_der =
+ chromeos::platform_keys::GetSubjectPublicKeyInfo(cert_x509);
+ if (!chromeos::platform_keys::GetPublicKey(cert_x509, &key_info.key_type,
+ &key_info.key_size_bits) ||
key_info.key_type != net::X509Certificate::kPublicKeyTypeRSA) {
return RespondNow(Error(kErrorAlgorithmNotSupported));
}
@@ -154,7 +155,7 @@ PlatformKeysInternalSelectClientCertificatesFunction::Run() {
}
service->SelectClientCertificates(
- request, extension_id(),
+ request, params->details.interactive, extension_id(),
base::Bind(&PlatformKeysInternalSelectClientCertificatesFunction::
OnSelectedCertificates,
this));
@@ -173,9 +174,10 @@ void PlatformKeysInternalSelectClientCertificatesFunction::
std::vector<linked_ptr<api_pk::Match>> result_matches;
for (const scoped_refptr<net::X509Certificate>& match : *matches) {
PublicKeyInfo key_info;
- if (!chromeos::platform_keys::GetPublicKey(
- match, &key_info.public_key_spki_der, &key_info.key_type,
- &key_info.key_size_bits)) {
+ key_info.public_key_spki_der =
+ chromeos::platform_keys::GetSubjectPublicKeyInfo(match);
+ if (!chromeos::platform_keys::GetPublicKey(match, &key_info.key_type,
+ &key_info.key_size_bits)) {
LOG(ERROR) << "Could not retrieve public key info.";
continue;
}

Powered by Google App Engine
This is Rietveld 408576698