| Index: chromeos/network/managed_network_configuration_handler_impl.cc
|
| diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc
|
| index ebe5d542193f61795141c4711827b82b7c960a4e..3158f0968e58447b353258a246bc3ee802a50274 100644
|
| --- a/chromeos/network/managed_network_configuration_handler_impl.cc
|
| +++ b/chromeos/network/managed_network_configuration_handler_impl.cc
|
| @@ -30,6 +30,7 @@
|
| #include "chromeos/network/network_ui_data.h"
|
| #include "chromeos/network/onc/onc_merger.h"
|
| #include "chromeos/network/onc/onc_signature.h"
|
| +#include "chromeos/network/onc/onc_translation_tables.h"
|
| #include "chromeos/network/onc/onc_translator.h"
|
| #include "chromeos/network/onc/onc_validator.h"
|
| #include "chromeos/network/policy_util.h"
|
| @@ -265,6 +266,12 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties(
|
| return;
|
| }
|
|
|
| + // We need to ensure that required configuration properties (e.g. Type) are
|
| + // included for ONC validation.
|
| + scoped_ptr<base::DictionaryValue> user_settings_copy(
|
| + network_util::TranslateNetworkConfigurationStateToONC(state));
|
| + user_settings_copy->MergeDictionary(&user_settings);
|
| +
|
| // Validate the ONC dictionary. We are liberal and ignore unknown field
|
| // names. User settings are only partial ONC, thus we ignore missing fields.
|
| onc::Validator validator(false, // Ignore unknown fields.
|
| @@ -276,7 +283,7 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties(
|
| scoped_ptr<base::DictionaryValue> validated_user_settings =
|
| validator.ValidateAndRepairObject(
|
| &onc::kNetworkConfigurationSignature,
|
| - user_settings,
|
| + *user_settings_copy,
|
| &validation_result);
|
|
|
| if (validation_result == onc::Validator::INVALID) {
|
|
|