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

Unified Diff: chromeos/network/client_cert_util.cc

Issue 410113002: Fix WiFi config view for previously configured client cert. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 | « chromeos/network/client_cert_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/client_cert_util.cc
diff --git a/chromeos/network/client_cert_util.cc b/chromeos/network/client_cert_util.cc
index 57eb4fda1de14cf3679185df5fd83f1fd98150bb..4957e0e5c808d1eef1f55a3636bca0e402a9c38e 100644
--- a/chromeos/network/client_cert_util.cc
+++ b/chromeos/network/client_cert_util.cc
@@ -218,6 +218,22 @@ scoped_refptr<net::X509Certificate> GetCertificateMatch(
return latest;
}
+std::string GetPkcs11IdFromEapCertId(const std::string& cert_id) {
+ if (cert_id.empty())
+ return std::string();
+
+ size_t delimiter_pos = cert_id.find(':');
+ if (delimiter_pos == std::string::npos) {
+ // No delimiter found, so |cert_id| only contains the PKCS11 id.
+ return cert_id;
+ }
+ if (delimiter_pos + 1 >= cert_id.size()) {
+ LOG(ERROR) << "Empty PKCS11 id in cert id.";
+ return std::string();
+ }
+ return cert_id.substr(delimiter_pos + 1);
+}
+
void SetShillProperties(const ConfigType cert_config_type,
const std::string& tpm_slot,
const std::string& tpm_pin,
« no previous file with comments | « chromeos/network/client_cert_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698