| 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..c060433b909b6e87ebe660765365ddefc409a569 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
|
| @@ -188,7 +202,19 @@ void NetworkConfigurationHandler::SetProperties(
|
| const base::DictionaryValue& properties,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) {
|
| + if (properties.empty()) {
|
| + if (!callback.is_null())
|
| + callback.Run();
|
| + return;
|
| + }
|
| 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,
|
| @@ -203,7 +229,16 @@ void NetworkConfigurationHandler::ClearProperties(
|
| const std::vector<std::string>& names,
|
| const base::Closure& callback,
|
| const network_handler::ErrorCallback& error_callback) {
|
| + if (names.empty()) {
|
| + if (!callback.is_null())
|
| + callback.Run();
|
| + return;
|
| + }
|
| 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 +254,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
|
|
|