| OLD | NEW |
| 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 "chromeos/network/policy_util.h" | 5 #include "chromeos/network/policy_util.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "chromeos/network/network_profile.h" | 9 #include "chromeos/network/network_profile.h" |
| 10 #include "chromeos/network/network_ui_data.h" | 10 #include "chromeos/network/network_ui_data.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 effective = normalizer.NormalizeObject(&onc::kNetworkConfigurationSignature, | 171 effective = normalizer.NormalizeObject(&onc::kNetworkConfigurationSignature, |
| 172 *effective); | 172 *effective); |
| 173 | 173 |
| 174 scoped_ptr<base::DictionaryValue> shill_dictionary( | 174 scoped_ptr<base::DictionaryValue> shill_dictionary( |
| 175 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, | 175 onc::TranslateONCObjectToShill(&onc::kNetworkConfigurationSignature, |
| 176 *effective)); | 176 *effective)); |
| 177 | 177 |
| 178 shill_dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, | 178 shill_dictionary->SetStringWithoutPathExpansion(shill::kProfileProperty, |
| 179 profile.path); | 179 profile.path); |
| 180 | 180 |
| 181 scoped_ptr<NetworkUIData> ui_data; | 181 scoped_ptr<NetworkUIData> ui_data(NetworkUIData::CreateFromONC(onc_source)); |
| 182 if (policy) | |
| 183 ui_data = NetworkUIData::CreateFromONC(onc_source, *policy); | |
| 184 else | |
| 185 ui_data.reset(new NetworkUIData()); | |
| 186 | 182 |
| 187 if (settings) { | 183 if (settings) { |
| 188 // Shill doesn't know that sensitive data is contained in the UIData | 184 // Shill doesn't know that sensitive data is contained in the UIData |
| 189 // property and might write it into logs or other insecure places. Thus, we | 185 // property and might write it into logs or other insecure places. Thus, we |
| 190 // have to remove or mask credentials. | 186 // have to remove or mask credentials. |
| 191 // | 187 // |
| 192 // Shill's GetProperties doesn't return credentials. Masking credentials | 188 // Shill's GetProperties doesn't return credentials. Masking credentials |
| 193 // instead of just removing them, allows remembering if a credential is set | 189 // instead of just removing them, allows remembering if a credential is set |
| 194 // or not. | 190 // or not. |
| 195 scoped_ptr<base::DictionaryValue> sanitized_settings( | 191 scoped_ptr<base::DictionaryValue> sanitized_settings( |
| (...skipping 17 matching lines...) Expand all Loading... |
| 213 it != policies.end(); ++it) { | 209 it != policies.end(); ++it) { |
| 214 if (IsPolicyMatching(*it->second, actual_network)) | 210 if (IsPolicyMatching(*it->second, actual_network)) |
| 215 return it->second; | 211 return it->second; |
| 216 } | 212 } |
| 217 return NULL; | 213 return NULL; |
| 218 } | 214 } |
| 219 | 215 |
| 220 } // namespace policy_util | 216 } // namespace policy_util |
| 221 | 217 |
| 222 } // namespace chromeos | 218 } // namespace chromeos |
| OLD | NEW |