Index: chromeos/network/network_configuration_handler.cc |
diff --git a/chromeos/network/network_configuration_handler.cc b/chromeos/network/network_configuration_handler.cc |
index f7f118ee4dae1273501cc80b0ca1d94e7ad7e1f9..6ad5489622661db9f64c46d7c47565e0ce75f114 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" |
@@ -66,6 +67,19 @@ void GetPropertiesCallback( |
*properties_copy.get()); |
} |
+bool IsPassphrase(const std::string& key) { |
+ return key == flimflam::kEapPrivateKeyPasswordProperty || |
+ key == flimflam::kEapPasswordProperty || |
+ key == flimflam::kL2tpIpsecPasswordProperty || |
+ key == flimflam::kOpenVPNPasswordProperty || |
+ key == flimflam::kPassphraseProperty || |
+ key == flimflam::kOpenVPNOTPProperty || |
+ key == flimflam::kEapPrivateKeyProperty || |
+ key == flimflam::kEapPrivateKeyPasswordProperty || |
+ key == flimflam::kEapPinProperty || |
+ key == flimflam::kApnPasswordProperty; |
+} |
+ |
} // namespace |
// Helper class to request from Shill the profile entries associated with a |
@@ -189,6 +203,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, |
@@ -204,6 +225,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, |
@@ -219,9 +244,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 |