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

Side by Side Diff: chrome/browser/chromeos/policy/network_configuration_updater_impl_cros.cc

Issue 16946002: Resolve certificate references in ONC by PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added a unit test for the resolve function. Created 7 years, 5 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/policy/network_configuration_updater_impl_cros .h" 5 #include "chrome/browser/chromeos/policy/network_configuration_updater_impl_cros .h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 << chromeos::onc::GetSourceAsString(onc_source) 158 << chromeos::onc::GetSourceAsString(onc_source)
159 << " is not a string value."; 159 << " is not a string value.";
160 } 160 }
161 } 161 }
162 162
163 base::ListValue network_configs; 163 base::ListValue network_configs;
164 base::ListValue certificates; 164 base::ListValue certificates;
165 ParseAndValidateOncForImport( 165 ParseAndValidateOncForImport(
166 onc_blob, onc_source, "", &network_configs, &certificates); 166 onc_blob, onc_source, "", &network_configs, &certificates);
167 167
168 network_library_->LoadOncNetworks(network_configs, onc_source); 168 chromeos::CertificateHandler::CertsByGUID imported_server_and_ca_certs;
169
170 scoped_ptr<net::CertificateList> web_trust_certs(new net::CertificateList); 169 scoped_ptr<net::CertificateList> web_trust_certs(new net::CertificateList);
171 certificate_handler_->ImportCertificates( 170 certificate_handler_->ImportCertificates(
172 certificates, onc_source, web_trust_certs.get()); 171 certificates, onc_source, web_trust_certs.get(),
172 &imported_server_and_ca_certs);
173
174 if (!chromeos::onc::ResolveServerCertRefsInNetworks(
175 imported_server_and_ca_certs, &network_configs)) {
176 LOG(ERROR) << "Some certificate references in the ONC policy for source "
177 << chromeos::onc::GetSourceAsString(onc_source)
178 << " could not be resolved.";
179 }
180
181 network_library_->LoadOncNetworks(network_configs, onc_source);
173 182
174 if (onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY) 183 if (onc_source == chromeos::onc::ONC_SOURCE_USER_POLICY)
175 SetTrustAnchors(web_trust_certs.Pass()); 184 SetTrustAnchors(web_trust_certs.Pass());
176 } 185 }
177 186
178 } // namespace policy 187 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698