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

Unified Diff: chromeos/network/network_state.cc

Issue 20087002: Add migration from CaCert NSS nicknames to PEM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unittests depending on NetworkHandler and not on CertLoader. Created 7 years, 4 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
« no previous file with comments | « chromeos/network/network_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state.cc
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index ca0b7b65591bceaf393ecb405de3864c16c05c83..f0da62d64c1978945a6bb80d385d55838746b739 100644
--- a/chromeos/network/network_state.cc
+++ b/chromeos/network/network_state.cc
@@ -68,6 +68,33 @@ chromeos::NetworkUIData* CreateUIDataFromValue(
return new chromeos::NetworkUIData(*ui_data_dict);
}
+bool IsCaCertNssSet(const base::DictionaryValue& properties) {
+ std::string ca_cert_nss;
+ if (properties.GetStringWithoutPathExpansion(flimflam::kEapCaCertNssProperty,
+ &ca_cert_nss) &&
+ !ca_cert_nss.empty()) {
+ return true;
+ }
+
+ const base::DictionaryValue* provider = NULL;
+ properties.GetDictionaryWithoutPathExpansion(flimflam::kProviderProperty,
+ &provider);
+ if (!provider)
+ return false;
+ if (provider->GetStringWithoutPathExpansion(
+ flimflam::kL2tpIpsecCaCertNssProperty, &ca_cert_nss) &&
+ !ca_cert_nss.empty()) {
+ return true;
+ }
+ if (provider->GetStringWithoutPathExpansion(
+ flimflam::kOpenVPNCaCertNSSProperty, &ca_cert_nss) &&
+ !ca_cert_nss.empty()) {
+ return true;
+ }
+
+ return false;
+}
+
} // namespace
namespace chromeos {
@@ -82,7 +109,8 @@ NetworkState::NetworkState(const std::string& path)
signal_strength_(0),
connectable_(false),
activate_over_non_cellular_networks_(false),
- cellular_out_of_credits_(false) {
+ cellular_out_of_credits_(false),
+ has_ca_cert_nss_(false) {
}
NetworkState::~NetworkState() {
@@ -191,6 +219,9 @@ bool NetworkState::PropertyChanged(const std::string& key,
bool NetworkState::InitialPropertiesReceived(
const base::DictionaryValue& properties) {
bool changed = UpdateName(properties);
+ bool had_ca_cert_nss = has_ca_cert_nss_;
+ has_ca_cert_nss_ = IsCaCertNssSet(properties);
+ changed |= had_ca_cert_nss != has_ca_cert_nss_;
return changed;
}
« no previous file with comments | « chromeos/network/network_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698