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

Unified Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 421113002: Use correct slot id for client certs in network config. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 6 years, 5 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/chromeos/options/vpn_config_view.cc
diff --git a/chrome/browser/chromeos/options/vpn_config_view.cc b/chrome/browser/chromeos/options/vpn_config_view.cc
index f059ee8f19f9f65dba14fe24e0f9d80c534623e9..5894356341aa3668d7ebab4911edef6109b838fc 100644
--- a/chrome/browser/chromeos/options/vpn_config_view.cc
+++ b/chrome/browser/chromeos/options/vpn_config_view.cc
@@ -453,13 +453,21 @@ const std::string VPNConfigView::GetServerCACertPEM() const {
}
}
-const std::string VPNConfigView::GetUserCertID() const {
+void VPNConfigView::SetUserCertProperties(
+ chromeos::client_cert::ConfigType client_cert_type,
+ base::DictionaryValue* properties) const {
if (!HaveUserCerts()) {
- return std::string(); // "None installed"
+ // No certificate selected or not required.
+ chromeos::client_cert::SetEmptyShillProperties(
+ chromeos::client_cert::CONFIG_TYPE_EAP, properties);
} else {
// Certificates are listed in the order they appear in the model.
int index = user_cert_combobox_ ? user_cert_combobox_->selected_index() : 0;
- return CertLibrary::Get()->GetUserCertPkcs11IdAt(index);
+ int slot_id = -1;
+ const std::string pkcs11_id =
+ CertLibrary::Get()->GetUserCertPkcs11IdAt(index, &slot_id);
+ chromeos::client_cert::SetShillProperties(
+ client_cert_type, slot_id, pkcs11_id, properties);
}
}
@@ -837,8 +845,7 @@ void VPNConfigView::SetConfigProperties(
properties->SetWithoutPathExpansion(
shill::kL2tpIpsecCaCertPemProperty, pem_list);
}
- properties->SetStringWithoutPathExpansion(
- shill::kL2tpIpsecClientCertIdProperty, GetUserCertID());
+ SetUserCertProperties(client_cert::CONFIG_TYPE_IPSEC, properties);
if (!group_name.empty()) {
properties->SetStringWithoutPathExpansion(
shill::kL2tpIpsecTunnelGroupProperty, GetGroupName());
@@ -861,8 +868,7 @@ void VPNConfigView::SetConfigProperties(
properties->SetWithoutPathExpansion(
shill::kOpenVPNCaCertPemProperty, pem_list);
}
- properties->SetStringWithoutPathExpansion(
- shill::kOpenVPNClientCertIdProperty, GetUserCertID());
+ SetUserCertProperties(client_cert::CONFIG_TYPE_OPENVPN, properties);
properties->SetStringWithoutPathExpansion(
shill::kOpenVPNUserProperty, GetUsername());
if (!user_passphrase.empty()) {
« no previous file with comments | « chrome/browser/chromeos/options/vpn_config_view.h ('k') | chrome/browser/chromeos/options/wifi_config_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698