OLD | NEW |
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 Loading... |
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 |
OLD | NEW |