Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: chrome/browser/policy/configuration_policy_handler_chromeos.cc

Issue 8949056: This adds support for encrypted ONC import (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed merge Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/chromeos/cros/onc_network_parser_unittest.cc ('k') | crypto/hmac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/cros/onc_network_parser_unittest.cc ('k') | crypto/hmac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698