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

Unified Diff: flimflam.cc

Issue 2836076: Use ConfigureWifiService() instead of GetWifiService() (Closed) Base URL: ssh://git@chromiumos-git/entd.git
Patch Set: Created 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: flimflam.cc
diff --git a/flimflam.cc b/flimflam.cc
index e11d04fb546944e9f1f20c8d6bdb21be0023f7b9..3a8fd553943b3ef876377b4d7ec73370767c0a76 100644
--- a/flimflam.cc
+++ b/flimflam.cc
@@ -18,6 +18,7 @@
namespace entd {
using chromeos::FreeServiceInfo;
using chromeos::GetWifiService;
+using chromeos::ConfigureWifiService;
using chromeos::ServiceInfo;
const char Flimflam::kLibcrosPath[] =
@@ -86,24 +87,11 @@ static v8::Handle<v8::Value> dispatch_configNetwork(const v8::Arguments& args) {
if (!Load(&error))
return v8_fail(error);
- ServiceInfo* ssid_info = GetWifiService(ssid.c_str(),
- chromeos::SECURITY_8021X);
- if (ssid_info) {
- if (!chromeos::SetIdentity(ssid_info->service_path, user.c_str())) {
- FreeServiceInfo(ssid_info);
- return v8_fail("Failed to set identity");
- }
- if (!chromeos::SetPassphrase(ssid_info->service_path, pass.c_str())) {
- FreeServiceInfo(ssid_info);
- return v8_fail("Failed to set passphrase");
- }
- if (!chromeos::SetCertPath(ssid_info->service_path, cert_path.c_str())) {
- FreeServiceInfo(ssid_info);
- return v8_fail("Failed to set cert path");
- }
- return v8::True();
- }
- return v8::False();
+ if (!ConfigureWifiService(ssid.c_str(),chromeos::SECURITY_8021X,
+ pass.c_str(), user.c_str(), cert_path.c_str()))
+ return v8_fail("Failed to configure wifi service");
+
+ return v8::True();
}
// bool disconnectNetwork(const char* ssid);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698