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

Unified Diff: chromeos/network/client_cert_util.cc

Issue 2828713002: Enable client certificate patterns in device ONC policy (Closed)
Patch Set: Rebase. Created 3 years, 8 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: chromeos/network/client_cert_util.cc
diff --git a/chromeos/network/client_cert_util.cc b/chromeos/network/client_cert_util.cc
index 361664f27fa63ecf9a0a5a125b8100c8636bdd75..27fe56bdac2d617452e604cd77dbe7c0ea8e6963 100644
--- a/chromeos/network/client_cert_util.cc
+++ b/chromeos/network/client_cert_util.cc
@@ -39,8 +39,12 @@ std::string GetStringFromDictionary(const base::DictionaryValue& dict,
}
void GetClientCertTypeAndPattern(
+ onc::ONCSource onc_source,
const base::DictionaryValue& dict_with_client_cert,
ClientCertConfig* cert_config) {
+ cert_config->source_is_device_policy_ =
+ onc_source != onc::ONC_SOURCE_USER_POLICY;
+
dict_with_client_cert.GetStringWithoutPathExpansion(
::onc::eap::kIdentity, &cert_config->policy_identity);
@@ -266,7 +270,8 @@ ClientCertConfig::ClientCertConfig()
ClientCertConfig::ClientCertConfig(const ClientCertConfig& other) = default;
-void OncToClientCertConfig(const base::DictionaryValue& network_config,
+void OncToClientCertConfig(::onc::ONCSource onc_source,
+ const base::DictionaryValue& network_config,
ClientCertConfig* cert_config) {
using namespace ::onc;
@@ -317,8 +322,10 @@ void OncToClientCertConfig(const base::DictionaryValue& network_config,
cert_config->location = CONFIG_TYPE_EAP;
}
- if (dict_with_client_cert)
- GetClientCertTypeAndPattern(*dict_with_client_cert, cert_config);
+ if (dict_with_client_cert) {
+ GetClientCertTypeAndPattern(onc_source, *dict_with_client_cert,
+ cert_config);
+ }
}
bool IsCertificateConfigured(const ConfigType cert_config_type,

Powered by Google App Engine
This is Rietveld 408576698