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

Unified Diff: chrome/browser/chromeos/policy/network_configuration_updater.cc

Issue 148183013: Use per-user nssdb in onc certificate importer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 10 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/policy/network_configuration_updater.cc
diff --git a/chrome/browser/chromeos/policy/network_configuration_updater.cc b/chrome/browser/chromeos/policy/network_configuration_updater.cc
index ce72dd8bd4a5e9ce111c63bfd9886135aa5f5b79..fb5d4089bfc07418d9e94732f57b366b06f33ae7 100644
--- a/chrome/browser/chromeos/policy/network_configuration_updater.cc
+++ b/chrome/browser/chromeos/policy/network_configuration_updater.cc
@@ -37,6 +37,17 @@ void NetworkConfigurationUpdater::OnPolicyServiceInitialized(
}
}
+void NetworkConfigurationUpdater::SetCertDatabase(
+ net::NSSCertDatabase* cert_database) {
+ DCHECK(!cert_database_);
+ cert_database_ = cert_database;
+
+ // If the policy service is ready, the policy has to be reapplied to ensure
+ // certificates are imported.
+ if (policy_service_->IsInitializationComplete(POLICY_DOMAIN_CHROME))
+ ApplyPolicy();
+}
+
NetworkConfigurationUpdater::NetworkConfigurationUpdater(
onc::ONCSource onc_source,
std::string policy_key,
@@ -50,7 +61,8 @@ NetworkConfigurationUpdater::NetworkConfigurationUpdater(
policy_change_registrar_(policy_service,
PolicyNamespace(POLICY_DOMAIN_CHROME,
std::string())),
- policy_service_(policy_service) {
+ policy_service_(policy_service),
+ cert_database_(NULL) {
}
void NetworkConfigurationUpdater::Init() {
@@ -95,7 +107,8 @@ void NetworkConfigurationUpdater::ApplyPolicy() {
&global_network_config,
&certificates);
- ImportCertificates(certificates);
+ if (cert_database_)
+ ImportCertificates(certificates, cert_database_);
ApplyNetworkPolicy(&network_configs, &global_network_config);
}

Powered by Google App Engine
This is Rietveld 408576698