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

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

Issue 1141253003: chrome.platformKeys: Add filtering by certificate types (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed pneubeck's comments Created 5 years, 7 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 d346aa87bd591983c4618bd98979cb5d864fa782..c6301e977d3663ebb84ef62c97fb923e5fa2bb8e 100644
--- a/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
+++ b/chrome/browser/extensions/api/platform_keys/platform_keys_api.cc
@@ -168,6 +168,21 @@ PlatformKeysInternalSelectClientCertificatesFunction::Run() {
request.certificate_authorities.push_back(
std::string(cert_authority.begin(), cert_authority.end()));
}
+ for (const api_pk::ClientCertificateType& cert_type :
+ params->details.request.certificate_types) {
+ switch (cert_type) {
+ case api_pk::CLIENT_CERTIFICATE_TYPE_ECDSASIGN:
+ request.certificate_key_types.push_back(
+ net::X509Certificate::kPublicKeyTypeECDSA);
+ break;
+ case api_pk::CLIENT_CERTIFICATE_TYPE_RSASIGN:
+ request.certificate_key_types.push_back(
+ net::X509Certificate::kPublicKeyTypeRSA);
+ break;
+ case api_pk::CLIENT_CERTIFICATE_TYPE_NONE:
+ NOTREACHED();
+ }
+ }
content::WebContents* web_contents = nullptr;
if (params->details.interactive) {
web_contents = GetSenderWebContents();
« no previous file with comments | « chrome/browser/chromeos/platform_keys/platform_keys_service.cc ('k') | chrome/common/extensions/api/platform_keys.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698