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

Unified Diff: chrome/browser/chromeos/options/wifi_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
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view.h ('k') | chromeos/cert_loader.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/options/wifi_config_view.cc
diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc
index 71b25b808d78b12580a2b5f2f73117cc3ff15c2b..b2d464c492c0cf43be955e88489ffe268bb4a657 100644
--- a/chrome/browser/chromeos/options/wifi_config_view.cc
+++ b/chrome/browser/chromeos/options/wifi_config_view.cc
@@ -22,7 +22,6 @@
#include "chromeos/network/network_state_handler.h"
#include "chromeos/network/network_ui_data.h"
#include "chromeos/network/shill_property_util.h"
-#include "chromeos/tpm_token_loader.h"
#include "components/onc/onc_constants.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -735,9 +734,6 @@ bool WifiConfigView::Login() {
properties.SetStringWithoutPathExpansion(shill::kTypeProperty,
shill::kTypeEthernetEap);
share_network = false;
- // Set the TPM PIN.
- properties.SetStringWithoutPathExpansion(
- shill::kEapPinProperty, TPMTokenLoader::Get()->tpm_user_pin());
ash::network_connect::CreateConfiguration(&properties, share_network);
} else {
ash::network_connect::ConfigureNetworkAndConnect(
@@ -840,14 +836,21 @@ std::string WifiConfigView::GetEapSubjectMatch() const {
return base::UTF16ToUTF8(subject_match_textfield_->text());
}
-std::string WifiConfigView::GetEapClientCertPkcs11Id() const {
+void WifiConfigView::SetEapClientCertProperties(
+ base::DictionaryValue* properties) const {
DCHECK(user_cert_combobox_);
if (!HaveUserCerts() || !UserCertActive()) {
- return std::string(); // No certificate selected or not required.
+ // No certificate selected or not required.
+ client_cert::SetEmptyShillProperties(client_cert::CONFIG_TYPE_EAP,
+ properties);
} else {
// Certificates are listed in the order they appear in the model.
int index = user_cert_combobox_->selected_index();
- return CertLibrary::Get()->GetUserCertPkcs11IdAt(index);
+ int slot_id = -1;
+ const std::string pkcs11_id =
+ CertLibrary::Get()->GetUserCertPkcs11IdAt(index, &slot_id);
+ client_cert::SetShillProperties(
+ client_cert::CONFIG_TYPE_EAP, slot_id, pkcs11_id, properties);
}
}
@@ -873,12 +876,7 @@ void WifiConfigView::SetEapProperties(base::DictionaryValue* properties) {
properties->SetStringWithoutPathExpansion(
shill::kEapSubjectMatchProperty, GetEapSubjectMatch());
- const std::string pkcs11id = GetEapClientCertPkcs11Id();
- client_cert::SetShillProperties(client_cert::CONFIG_TYPE_EAP,
- CertLibrary::Get()->GetTPMSlotID(),
- TPMTokenLoader::Get()->tpm_user_pin(),
- &pkcs11id,
- properties);
+ SetEapClientCertProperties(properties);
properties->SetBooleanWithoutPathExpansion(
shill::kEapUseSystemCasProperty, GetEapUseSystemCas());
« no previous file with comments | « chrome/browser/chromeos/options/wifi_config_view.h ('k') | chromeos/cert_loader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698