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

Side by Side Diff: components/wifi/wifi_test.cc

Issue 102993002: Implement Networking Private API VerifyAndEncryptCredentials method (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use utility process to get and encrypt wifi passphrase. Created 6 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« chrome/utility/DEPS ('K') | « components/wifi/wifi_service_win.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 <stdio.h> 5 #include <stdio.h>
6 #include <string> 6 #include <string>
7 7
8 #include "base/at_exit.h" 8 #include "base/at_exit.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 // Need AtExitManager to support AsWeakPtr (in NetLog). 59 // Need AtExitManager to support AsWeakPtr (in NetLog).
60 base::AtExitManager exit_manager_; 60 base::AtExitManager exit_manager_;
61 61
62 Result result_; 62 Result result_;
63 }; 63 };
64 64
65 WiFiTest::Result WiFiTest::Main(int argc, const char* argv[]) { 65 WiFiTest::Result WiFiTest::Main(int argc, const char* argv[]) {
66 if (!ParseCommandLine(argc, argv)) { 66 if (!ParseCommandLine(argc, argv)) {
67 VLOG(0) << "Usage: " << argv[0] << 67 VLOG(0) << "Usage: " << argv[0] <<
68 " [--list]" 68 " [--list]"
69 " [--get_password]"
69 " [--get_properties]" 70 " [--get_properties]"
70 " [--create]" 71 " [--create]"
71 " [--connect]" 72 " [--connect]"
72 " [--disconnect]" 73 " [--disconnect]"
73 " [--network_guid=<network_guid>]" 74 " [--network_guid=<network_guid>]"
74 " [--frequency=0|2400|5000]" 75 " [--frequency=0|2400|5000]"
75 " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]" 76 " [--security=none|WEP-PSK|WPA-PSK|WPA2-PSK]"
76 " [--password=<wifi password>]" 77 " [--password=<wifi password>]"
77 " [<network_guid>]\n"; 78 " [<network_guid>]\n";
78 return RESULT_WRONG_USAGE; 79 return RESULT_WRONG_USAGE;
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 184
184 if (parsed_command_line.HasSwitch("disconnect")) { 185 if (parsed_command_line.HasSwitch("disconnect")) {
185 if (network_guid.length() > 0) { 186 if (network_guid.length() > 0) {
186 std::string error; 187 std::string error;
187 wifi_service->StartDisconnect(network_guid, &error); 188 wifi_service->StartDisconnect(network_guid, &error);
188 VLOG(0) << error; 189 VLOG(0) << error;
189 return true; 190 return true;
190 } 191 }
191 } 192 }
192 193
194 if (parsed_command_line.HasSwitch("get_password")) {
195 if (network_guid.length() > 0) {
196 std::string error;
197 std::string password;
198 wifi_service->GetPassphraseFromSystem(network_guid,
199 std::string(),
200 &password,
201 &error);
202 VLOG(0) << password << error;
203 return true;
204 }
205 }
206
193 return false; 207 return false;
194 } 208 }
195 209
196 } // namespace wifi 210 } // namespace wifi
197 211
198 int main(int argc, const char* argv[]) { 212 int main(int argc, const char* argv[]) {
199 CommandLine::Init(argc, argv); 213 CommandLine::Init(argc, argv);
200 logging::LoggingSettings settings; 214 logging::LoggingSettings settings;
201 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG; 215 settings.logging_dest = logging::LOG_TO_SYSTEM_DEBUG_LOG;
202 logging::InitLogging(settings); 216 logging::InitLogging(settings);
203 217
204 wifi::WiFiTest wifi_test; 218 wifi::WiFiTest wifi_test;
205 return wifi_test.Main(argc, argv); 219 return wifi_test.Main(argc, argv);
206 } 220 }
OLDNEW
« chrome/utility/DEPS ('K') | « components/wifi/wifi_service_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698