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

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: Using local namespace to supply "IEEE8021X" value 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..31ac0b62e1ca5b5e8d786945a6cd30cb3a0ccd33 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -27,6 +27,8 @@ namespace onc {
namespace {
+const char kKeyManagementIEEE8021X[] = "IEEE8021X";
stevenjb 2015/11/04 18:36:00 nit: TODO
+
// 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 +331,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);

Powered by Google App Engine
This is Rietveld 408576698