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

Unified Diff: chrome/browser/chromeos/cros/network_library.cc

Issue 3678006: Implement action interface in network_menu.js for 'connect'. (Closed)
Patch Set: Set status for non connected networks. Created 10 years, 2 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/cros/network_library.cc
diff --git a/chrome/browser/chromeos/cros/network_library.cc b/chrome/browser/chromeos/cros/network_library.cc
index e9575aa41c682f45ea1b33c20c9b0b26de922059..61c98d76bfb0ee1991bce51ec14ac8f6c5e9bfb0 100644
--- a/chrome/browser/chromeos/cros/network_library.cc
+++ b/chrome/browser/chromeos/cros/network_library.cc
@@ -388,7 +388,26 @@ std::string WifiNetwork::GetEncryptionString() {
case SECURITY_8021X:
return "8021X";
}
- return "Unknown";}
+ return "Unknown";
+}
+
+// Parse 'path' to determine if the certificate is stored in a pkcs#11 device.
+// flimflam recognizes the string "SETTINGS:" to specify authentication
+// parameters. 'key_id=' indicates that the certificate is stored in a pkcs#11
+// device. See src/third_party/flimflam/files/doc/service-api.txt.
+bool WifiNetwork::IsCertificateLoaded() const {
+ static const std::string settings_string("SETTINGS:");
+ static const std::string pkcs11_key("key_id");
+ if (cert_path_.find(settings_string) == 0) {
+ std::string::size_type idx = cert_path_.find(pkcs11_key);
+ if (idx != std::string::npos)
+ idx = cert_path_.find_first_not_of(kWhitespaceASCII,
+ idx + pkcs11_key.length());
+ if (idx != std::string::npos && cert_path_[idx] == '=')
+ return true;
+ }
+ return false;
+}
////////////////////////////////////////////////////////////////////////////////
// NetworkLibrary

Powered by Google App Engine
This is Rietveld 408576698