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

Side by Side Diff: chrome/browser/chromeos/cros/network_library_impl_base.cc

Issue 11970012: Add a check for server and CA certificates in device policies to the ONC validator. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed the wording in the spec. Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/chromeos/cros/network_library_impl_base.h" 5 #include "chrome/browser/chromeos/cros/network_library_impl_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/json/json_reader.h" 8 #include "base/json/json_reader.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/memory/scoped_vector.h" 10 #include "base/memory/scoped_vector.h"
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after
1133 root_dict->GetListWithoutPathExpansion(onc::kCertificates, &certificates); 1133 root_dict->GetListWithoutPathExpansion(onc::kCertificates, &certificates);
1134 1134
1135 const base::ListValue* network_configs; 1135 const base::ListValue* network_configs;
1136 bool has_network_configurations = root_dict->GetListWithoutPathExpansion( 1136 bool has_network_configurations = root_dict->GetListWithoutPathExpansion(
1137 onc::kNetworkConfigurations, 1137 onc::kNetworkConfigurations,
1138 &network_configs); 1138 &network_configs);
1139 1139
1140 if (has_certificates) { 1140 if (has_certificates) {
1141 VLOG(2) << "ONC file has " << certificates->GetSize() << " certificates"; 1141 VLOG(2) << "ONC file has " << certificates->GetSize() << " certificates";
1142 1142
1143 onc::CertificateImporter cert_importer(source, allow_web_trust_from_policy); 1143 // Web trust is only granted to certificates imported for a managed user
1144 // on a managed device and for user imports.
1145 bool allow_web_trust =
1146 (source == onc::ONC_SOURCE_USER_IMPORT) ||
1147 (source == onc::ONC_SOURCE_USER_POLICY && allow_web_trust_from_policy);
1148 onc::CertificateImporter cert_importer(allow_web_trust);
1144 if (cert_importer.ParseAndStoreCertificates(*certificates) != 1149 if (cert_importer.ParseAndStoreCertificates(*certificates) !=
1145 onc::CertificateImporter::IMPORT_OK) { 1150 onc::CertificateImporter::IMPORT_OK) {
1146 LOG(ERROR) << "Cannot parse some of the certificates in the ONC from " 1151 LOG(ERROR) << "Cannot parse some of the certificates in the ONC from "
1147 << onc::GetSourceAsString(source); 1152 << onc::GetSourceAsString(source);
1148 success = false; 1153 success = false;
1149 } 1154 }
1150 } 1155 }
1151 1156
1152 std::set<std::string> removal_ids; 1157 std::set<std::string> removal_ids;
1153 std::set<std::string>& network_ids(network_source_map_[source]); 1158 std::set<std::string>& network_ids(network_source_map_[source]);
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
1782 GetTpmInfo(); 1787 GetTpmInfo();
1783 return tpm_slot_; 1788 return tpm_slot_;
1784 } 1789 }
1785 1790
1786 const std::string& NetworkLibraryImplBase::GetTpmPin() { 1791 const std::string& NetworkLibraryImplBase::GetTpmPin() {
1787 GetTpmInfo(); 1792 GetTpmInfo();
1788 return tpm_pin_; 1793 return tpm_pin_;
1789 } 1794 }
1790 1795
1791 } // namespace chromeos 1796 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698