OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/policy/configuration_policy_handler_chromeos.h" | 5 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/json/json_reader.h" | 9 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool NetworkConfigurationPolicyHandler::CheckPolicySettings( | 28 bool NetworkConfigurationPolicyHandler::CheckPolicySettings( |
29 const PolicyMap& policies, | 29 const PolicyMap& policies, |
30 PolicyErrorMap* errors) { | 30 PolicyErrorMap* errors) { |
31 const Value* value; | 31 const Value* value; |
32 if (!CheckAndGetValue(policies, errors, &value)) | 32 if (!CheckAndGetValue(policies, errors, &value)) |
33 return false; | 33 return false; |
34 | 34 |
35 if (value) { | 35 if (value) { |
36 std::string onc_blob; | 36 std::string onc_blob; |
37 value->GetAsString(&onc_blob); | 37 value->GetAsString(&onc_blob); |
38 chromeos::OncNetworkParser parser(onc_blob, onc_source_); | 38 // Policy-based ONC blobs cannot have a passphrase. |
| 39 chromeos::OncNetworkParser parser(onc_blob, "", onc_source_); |
39 if (!parser.parse_error().empty()) { | 40 if (!parser.parse_error().empty()) { |
40 errors->AddError(policy_type(), | 41 errors->AddError(policy_type(), |
41 IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR, | 42 IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR, |
42 parser.parse_error()); | 43 parser.parse_error()); |
43 return false; | 44 return false; |
44 } | 45 } |
45 } | 46 } |
46 | 47 |
47 return true; | 48 return true; |
48 } | 49 } |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 118 |
118 for (size_t i = 0; i < arraysize(kFilteredSettings); ++i) { | 119 for (size_t i = 0; i < arraysize(kFilteredSettings); ++i) { |
119 if (network_dict->Remove(kFilteredSettings[i], NULL)) { | 120 if (network_dict->Remove(kFilteredSettings[i], NULL)) { |
120 network_dict->Set(kFilteredSettings[i], | 121 network_dict->Set(kFilteredSettings[i], |
121 Value::CreateStringValue(kPlaceholder)); | 122 Value::CreateStringValue(kPlaceholder)); |
122 } | 123 } |
123 } | 124 } |
124 } | 125 } |
125 | 126 |
126 } // namespace policy | 127 } // namespace policy |
OLD | NEW |