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

Side by Side Diff: chrome/browser/chromeos/options/vpn_config_view.cc

Issue 2485813002: Allow ECDSA certs to be used for VPN and wifi (Closed)
Patch Set: rebase on ToT Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/options/vpn_config_view.h" 5 #include "chrome/browser/chromeos/options/vpn_config_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 bool VPNConfigView::HaveUserCerts() const { 1022 bool VPNConfigView::HaveUserCerts() const {
1023 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0; 1023 return CertLibrary::Get()->NumCertificates(CertLibrary::CERT_TYPE_USER) > 0;
1024 } 1024 }
1025 1025
1026 bool VPNConfigView::IsUserCertValid() const { 1026 bool VPNConfigView::IsUserCertValid() const {
1027 if (!user_cert_combobox_ || !enable_user_cert_) 1027 if (!user_cert_combobox_ || !enable_user_cert_)
1028 return false; 1028 return false;
1029 int index = user_cert_combobox_->selected_index(); 1029 int index = user_cert_combobox_->selected_index();
1030 if (index < 0) 1030 if (index < 0)
1031 return false; 1031 return false;
1032 // Currently only hardware-backed user certificates are valid. 1032 // Make sure the certificate is hardware-backed if the hardware supports it.
1033 if (!CertLibrary::Get()->IsCertHardwareBackedAt(CertLibrary::CERT_TYPE_USER, 1033 if (!CertLibrary::Get()->IsCertSecureAt(CertLibrary::CERT_TYPE_USER, index)) {
1034 index)) {
1035 return false; 1034 return false;
1036 } 1035 }
1037 return true; 1036 return true;
1038 } 1037 }
1039 1038
1040 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield, 1039 const std::string VPNConfigView::GetTextFromField(views::Textfield* textfield,
1041 bool trim_whitespace) const { 1040 bool trim_whitespace) const {
1042 if (!textfield) 1041 if (!textfield)
1043 return std::string(); 1042 return std::string();
1044 std::string untrimmed = base::UTF16ToUTF8(textfield->text()); 1043 std::string untrimmed = base::UTF16ToUTF8(textfield->text());
(...skipping 24 matching lines...) Expand all
1069 property_ui_data->ParseOncProperty( 1068 property_ui_data->ParseOncProperty(
1070 onc_source, 1069 onc_source,
1071 onc, 1070 onc,
1072 base::StringPrintf("%s.%s.%s", 1071 base::StringPrintf("%s.%s.%s",
1073 ::onc::network_config::kVPN, 1072 ::onc::network_config::kVPN,
1074 dict_key.c_str(), 1073 dict_key.c_str(),
1075 key.c_str())); 1074 key.c_str()));
1076 } 1075 }
1077 1076
1078 } // namespace chromeos 1077 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/cert_library.cc ('k') | chrome/browser/chromeos/options/wifi_config_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698