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

Unified Diff: chrome/browser/chromeos/cros/network_library_impl_base.cc

Issue 13532005: Added a PolicyCertVerifier that uses the trust anchors from the ONC policies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: skip tests when NSS version is too old Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/cros/network_library_impl_base.cc
diff --git a/chrome/browser/chromeos/cros/network_library_impl_base.cc b/chrome/browser/chromeos/cros/network_library_impl_base.cc
index abe54b1e611e952064f2cb094dd01b0fabc8df42..6a67fe61a54d2c0ce2899ae62289f1907756cde7 100644
--- a/chrome/browser/chromeos/cros/network_library_impl_base.cc
+++ b/chrome/browser/chromeos/cros/network_library_impl_base.cc
@@ -1064,10 +1064,11 @@ class UserStringSubstitution : public onc::StringSubstitution {
} // namespace
-bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
- const std::string& passphrase,
- onc::ONCSource source,
- bool allow_web_trust_from_policy) {
+bool NetworkLibraryImplBase::LoadOncNetworks(
+ const std::string& onc_blob,
+ const std::string& passphrase,
+ onc::ONCSource source,
+ net::CertificateList* onc_trusted_certificates) {
VLOG(2) << __func__ << ": called on " << onc_blob;
NetworkProfile* profile = NULL;
bool from_policy = (source == onc::ONC_SOURCE_USER_POLICY ||
@@ -1152,13 +1153,11 @@ bool NetworkLibraryImplBase::LoadOncNetworks(const std::string& onc_blob,
if (has_certificates) {
VLOG(2) << "ONC file has " << certificates->GetSize() << " certificates";
- // Web trust is only granted to certificates imported for a managed user
- // on a managed device and for user imports.
- bool allow_web_trust =
- (source == onc::ONC_SOURCE_USER_IMPORT) ||
- (source == onc::ONC_SOURCE_USER_POLICY && allow_web_trust_from_policy);
- onc::CertificateImporter cert_importer(allow_web_trust);
- if (cert_importer.ParseAndStoreCertificates(*certificates) !=
+ // Web trust is only granted to certificates imported by the user.
+ bool allow_trust_imports = source == onc::ONC_SOURCE_USER_IMPORT;
+ onc::CertificateImporter cert_importer(allow_trust_imports);
+ if (cert_importer.ParseAndStoreCertificates(
+ *certificates, onc_trusted_certificates) !=
onc::CertificateImporter::IMPORT_OK) {
LOG(ERROR) << "Cannot parse some of the certificates in the ONC from "
<< onc::GetSourceAsString(source);

Powered by Google App Engine
This is Rietveld 408576698