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

Unified Diff: chromeos/network/network_configuration_handler.cc

Issue 21046008: Convert all connect code to use NetworkHandler instead of NetworkLibrary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restore check VPN PassphraseRequred Created 7 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
Index: chromeos/network/network_configuration_handler.cc
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc
index befb207c0ac088c9ca1629a50c2701f3baaa1ba1..66af83eb7ce9aedf96345469291359d79317a760 100644
--- a/chromeos/network/network_configuration_handler.cc
+++ b/chromeos/network/network_configuration_handler.cc
@@ -9,6 +9,7 @@
#include "base/bind.h"
#include "base/format_macros.h"
+#include "base/json/json_writer.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -47,6 +48,15 @@ void InvokeErrorCallback(const std::string& error,
error_callback.Run(error, error_data.Pass());
}
+bool IsPassphrase(const std::string& key) {
+ return key == flimflam::kEapPrivateKeyPasswordProperty ||
gauravsh 2013/08/02 23:40:22 Looking at service_constants.h, should the followi
stevenjb 2013/08/06 00:32:48 Added.
+ key == flimflam::kEapPasswordProperty ||
+ key == flimflam::kL2tpIpsecPasswordProperty ||
+ key == flimflam::kOpenVPNPasswordProperty ||
+ key == flimflam::kPassphraseProperty ||
+ key == flimflam::kOpenVPNOTPProperty;
+}
+
} // namespace
// Helper class to request from Shill the profile entries associated with a
@@ -170,6 +180,13 @@ void NetworkConfigurationHandler::SetProperties(
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) {
NET_LOG_USER("SetProperties", service_path);
+ for (base::DictionaryValue::Iterator iter(properties);
+ !iter.IsAtEnd(); iter.Advance()) {
+ std::string v = "******";
+ if (!IsPassphrase(iter.key()))
+ base::JSONWriter::Write(&iter.value(), &v);
+ NET_LOG_DEBUG("SetProperty", service_path + "." + iter.key() + "=" + v);
+ }
DBusThreadManager::Get()->GetShillServiceClient()->SetProperties(
dbus::ObjectPath(service_path),
properties,
@@ -185,6 +202,10 @@ void NetworkConfigurationHandler::ClearProperties(
const base::Closure& callback,
const network_handler::ErrorCallback& error_callback) {
NET_LOG_USER("ClearProperties", service_path);
+ for (std::vector<std::string>::const_iterator iter = names.begin();
+ iter != names.end(); ++iter) {
+ NET_LOG_DEBUG("ClearProperty", service_path + "." + *iter);
+ }
DBusThreadManager::Get()->GetShillServiceClient()->ClearProperties(
dbus::ObjectPath(service_path),
names,
@@ -200,9 +221,18 @@ void NetworkConfigurationHandler::CreateConfiguration(
const network_handler::ErrorCallback& error_callback) {
ShillManagerClient* manager =
DBusThreadManager::Get()->GetShillManagerClient();
-
std::string type;
properties.GetStringWithoutPathExpansion(flimflam::kTypeProperty, &type);
+
+ NET_LOG_USER("CreateConfiguration", type);
+ for (base::DictionaryValue::Iterator iter(properties);
+ !iter.IsAtEnd(); iter.Advance()) {
+ std::string v = "******";
+ if (!IsPassphrase(iter.key()))
+ base::JSONWriter::Write(&iter.value(), &v);
+ NET_LOG_DEBUG("Configure", type + "." + iter.key() + "=" + v);
+ }
+
// Shill supports ConfigureServiceForProfile only for network type WiFi. In
// all other cases, we have to rely on GetService for now. This is
// unproblematic for VPN (user profile only), but will lead to inconsistencies

Powered by Google App Engine
This is Rietveld 408576698