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

Unified Diff: chromeos/network/onc/onc_translator_shill_to_onc.cc

Issue 1412283006: Translate 802.1x WEP ("Enterprise WEP") (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added TODOs Created 5 years, 1 month 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/onc/onc_translator_shill_to_onc.cc
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index f91950f534e12ab10524246e4ade547b386b820f..e76f5e6e207a3dee5c6a61bea32677f63a68ed04 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -27,6 +27,9 @@ namespace onc {
namespace {
+// TODO(pstew): Remove once crosreview.com/310644 lands and merges to Chrome.
+const char kKeyManagementIEEE8021X[] = "IEEE8021X";
+
// Converts |str| to a base::Value of the given |type|. If the conversion fails,
// returns NULL.
scoped_ptr<base::Value> ConvertStringToValue(const std::string& str,
@@ -329,8 +332,21 @@ void ShillToONCTranslator::TranslateVPN() {
}
void ShillToONCTranslator::TranslateWiFiWithState() {
- TranslateWithTableAndSet(shill::kSecurityClassProperty, kWiFiSecurityTable,
- ::onc::wifi::kSecurity);
+ std::string shill_security;
+ std::string shill_key_mgmt;
+ if (shill_dictionary_->GetStringWithoutPathExpansion(
+ shill::kSecurityClassProperty, &shill_security) &&
+ shill_security == shill::kSecurityWep &&
+ shill_dictionary_->GetStringWithoutPathExpansion(
+ shill::kEapKeyMgmtProperty, &shill_key_mgmt) &&
+ shill_key_mgmt == kKeyManagementIEEE8021X) {
+ onc_object_->SetStringWithoutPathExpansion(::onc::wifi::kSecurity,
+ ::onc::wifi::kWEP_8021X);
+ } else {
+ TranslateWithTableAndSet(shill::kSecurityClassProperty, kWiFiSecurityTable,
+ ::onc::wifi::kSecurity);
+ }
+
bool unknown_encoding = true;
std::string ssid = shill_property_util::GetSSIDFromProperties(
*shill_dictionary_, false /* verbose_logging */, &unknown_encoding);
« no previous file with comments | « chromeos/network/onc/onc_translator_onc_to_shill.cc ('k') | chromeos/network/onc/onc_translator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698