diff options
38 files changed, 63 insertions, 168 deletions
diff --git a/athena/system/network_selector.cc b/athena/system/network_selector.cc index 5653c3f..86450d4 100644 --- a/athena/system/network_selector.cc +++ b/athena/system/network_selector.cc @@ -243,7 +243,7 @@ class NetworkRow : public views::View { // If this is not a wifi network that needs a password, then ignore. if (network->type() != shill::kTypeWifi || - network->security() == shill::kSecurityNone) { + network->security_class() == shill::kSecurityNone) { return; } diff --git a/chrome/browser/chromeos/options/wifi_config_view.cc b/chrome/browser/chromeos/options/wifi_config_view.cc index 76be879..7cd0ea6 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.cc +++ b/chrome/browser/chromeos/options/wifi_config_view.cc @@ -679,17 +679,17 @@ bool WifiConfigView::Login() { shill::kModeProperty, shill::kModeManaged); properties.SetBooleanWithoutPathExpansion( shill::kSaveCredentialsProperty, GetSaveCredentials()); - std::string security = shill::kSecurityNone; + std::string security_class = shill::kSecurityNone; if (!eap_method_combobox_) { switch (security_combobox_->selected_index()) { case SECURITY_INDEX_NONE: - security = shill::kSecurityNone; + security_class = shill::kSecurityNone; break; case SECURITY_INDEX_WEP: - security = shill::kSecurityWep; + security_class = shill::kSecurityWep; break; case SECURITY_INDEX_PSK: - security = shill::kSecurityPsk; + security_class = shill::kSecurityPsk; break; } std::string passphrase = GetPassphrase(); @@ -698,11 +698,11 @@ bool WifiConfigView::Login() { shill::kPassphraseProperty, GetPassphrase()); } } else { - security = shill::kSecurity8021x; + security_class = shill::kSecurity8021x; SetEapProperties(&properties, false /* not configured */); } properties.SetStringWithoutPathExpansion( - shill::kSecurityProperty, security); + shill::kSecurityClassProperty, security_class); // Configure and connect to network. ui::NetworkConnect::Get()->CreateConfigurationAndConnect(&properties, @@ -899,7 +899,7 @@ void WifiConfigView::Init(bool show_8021x) { const NetworkState* network = GetNetworkState(); if (network) { if (network->type() == shill::kTypeWifi) { - if (network->security() == shill::kSecurity8021x) + if (network->security_class() == shill::kSecurity8021x) show_8021x = true; } else if (network->type() == shill::kTypeEthernet) { show_8021x = true; diff --git a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc index a56c4d1..d708c2b 100644 --- a/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc +++ b/chrome/browser/extensions/api/networking_private/networking_private_chromeos_apitest.cc @@ -256,7 +256,7 @@ class NetworkingPrivateChromeOSApiTest : public ExtensionApiTest { AddService("stub_wifi1", "wifi1", shill::kTypeWifi, shill::kStateOnline); service_test_->SetServiceProperty("stub_wifi1", - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurityWep)); service_test_->SetServiceProperty("stub_wifi1", shill::kSignalStrengthProperty, @@ -285,7 +285,7 @@ class NetworkingPrivateChromeOSApiTest : public ExtensionApiTest { AddService("stub_wifi2", "wifi2_PSK", shill::kTypeWifi, shill::kStateIdle); service_test_->SetServiceProperty("stub_wifi2", - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurityPsk)); service_test_->SetServiceProperty("stub_wifi2", shill::kSignalStrengthProperty, diff --git a/chromeos/dbus/fake_shill_manager_client.cc b/chromeos/dbus/fake_shill_manager_client.cc index 4c1aa9a..a328a9d 100644 --- a/chromeos/dbus/fake_shill_manager_client.cc +++ b/chromeos/dbus/fake_shill_manager_client.cc @@ -663,7 +663,7 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { state, add_to_visible); services->SetServiceProperty(kWifi1Path, - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurityWep)); services->SetServiceProperty(kWifi1Path, shill::kConnectableProperty, @@ -678,7 +678,7 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { shill::kStateIdle, add_to_visible); services->SetServiceProperty(kWifi2Path, - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurityPsk)); base::FundamentalValue strength_value(80); @@ -695,7 +695,7 @@ void FakeShillManagerClient::SetupDefaultEnvironment() { shill::kStatePortal, add_to_visible); services->SetServiceProperty(kPortaledWifiPath, - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurityNone)); services->SetConnectBehavior(kPortaledWifiPath, base::Bind(&UpdatePortaledWifiState, diff --git a/chromeos/dbus/fake_shill_service_client.cc b/chromeos/dbus/fake_shill_service_client.cc index 9751972..8bb234b 100644 --- a/chromeos/dbus/fake_shill_service_client.cc +++ b/chromeos/dbus/fake_shill_service_client.cc @@ -390,7 +390,7 @@ base::DictionaryValue* FakeShillServiceClient::SetServiceProperties( properties->SetStringWithoutPathExpansion(shill::kStateProperty, state); properties->SetBooleanWithoutPathExpansion(shill::kVisibleProperty, visible); if (type == shill::kTypeWifi) { - properties->SetStringWithoutPathExpansion(shill::kSecurityProperty, + properties->SetStringWithoutPathExpansion(shill::kSecurityClassProperty, shill::kSecurityNone); properties->SetStringWithoutPathExpansion(shill::kModeProperty, shill::kModeManaged); diff --git a/chromeos/dbus/shill_client_unittest_base.cc b/chromeos/dbus/shill_client_unittest_base.cc index bba6f95..2acfef1 100644 --- a/chromeos/dbus/shill_client_unittest_base.cc +++ b/chromeos/dbus/shill_client_unittest_base.cc @@ -347,7 +347,8 @@ ShillClientUnittestBase::CreateExampleServiceProperties() { new base::StringValue(shill::kTypeWifi)); shill_property_util::SetSSID("testssid", properties); properties->SetWithoutPathExpansion( - shill::kSecurityProperty, new base::StringValue(shill::kSecurityPsk)); + shill::kSecurityClassProperty, + new base::StringValue(shill::kSecurityPsk)); return properties; } diff --git a/chromeos/network/managed_network_configuration_handler_unittest.cc b/chromeos/network/managed_network_configuration_handler_unittest.cc index 44ac4a3..d40abda 100644 --- a/chromeos/network/managed_network_configuration_handler_unittest.cc +++ b/chromeos/network/managed_network_configuration_handler_unittest.cc @@ -725,42 +725,6 @@ TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyUpdateManagedVPN) { VerifyAndClearExpectations(); } -TEST_F(ManagedNetworkConfigurationHandlerTest, - SetPolicyUpdateManagedEquivalentSecurity) { - InitializeStandardProfiles(); - SetUpEntry("policy/shill_managed_wifi1_rsn.json", - kUser1ProfilePath, - "old_entry_path"); - - scoped_ptr<base::DictionaryValue> expected_shill_properties = - test_utils::ReadTestDictionary( - "policy/shill_policy_on_unmanaged_wifi1.json"); - - // The passphrase isn't sent again, because it's configured by the user and - // Shill doesn't send it on GetProperties calls. - expected_shill_properties->RemoveWithoutPathExpansion( - shill::kPassphraseProperty, NULL); - - EXPECT_CALL(*mock_profile_client_, - GetProperties(dbus::ObjectPath(kUser1ProfilePath), _, _)); - - EXPECT_CALL( - *mock_profile_client_, - GetEntry(dbus::ObjectPath(kUser1ProfilePath), "old_entry_path", _, _)); - - // The existing entry must not be deleted because the Security type 'rsa' is - // equivalent to 'psk' when identifying networks. - - EXPECT_CALL( - *mock_manager_client_, - ConfigureServiceForProfile(dbus::ObjectPath(kUser1ProfilePath), - IsEqualTo(expected_shill_properties.get()), - _, _)); - - SetPolicy(::onc::ONC_SOURCE_USER_POLICY, kUser1, "policy/policy_wifi1.onc"); - message_loop_.RunUntilIdle(); -} - TEST_F(ManagedNetworkConfigurationHandlerTest, SetPolicyReapplyToManaged) { InitializeStandardProfiles(); SetUpEntry("policy/shill_policy_on_unmanaged_wifi1.json", diff --git a/chromeos/network/network_cert_migrator.cc b/chromeos/network/network_cert_migrator.cc index 37dc0f8..9bc90db 100644 --- a/chromeos/network/network_cert_migrator.cc +++ b/chromeos/network/network_cert_migrator.cc @@ -45,7 +45,7 @@ class NetworkCertMigrator::MigrationTask // Request properties for each network that could be configured with a // client certificate. for (const NetworkState* network : networks) { - if (network->security() != shill::kSecurity8021x && + if (network->security_class() != shill::kSecurity8021x && network->type() != shill::kTypeVPN && network->type() != shill::kTypeEthernetEap) { continue; diff --git a/chromeos/network/network_cert_migrator_unittest.cc b/chromeos/network/network_cert_migrator_unittest.cc index 9ddb084..efb308f 100644 --- a/chromeos/network/network_cert_migrator_unittest.cc +++ b/chromeos/network/network_cert_migrator_unittest.cc @@ -122,7 +122,7 @@ class NetworkCertMigratorTest : public testing::Test { if (wifi) { service_test_->SetServiceProperty( name, - shill::kSecurityProperty, + shill::kSecurityClassProperty, base::StringValue(shill::kSecurity8021x)); } } diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc index 9187ed5..5fbdd79 100644 --- a/chromeos/network/network_connection_handler.cc +++ b/chromeos/network/network_connection_handler.cc @@ -91,7 +91,7 @@ std::string GetDefaultUserProfilePath(const NetworkState* network) { (LoginState::IsInitialized() && !LoginState::Get()->UserHasNetworkProfile()) || (network && network->type() == shill::kTypeWifi && - network->security() == shill::kSecurityNone)) { + network->security_class() == shill::kSecurityNone)) { return NetworkProfileHandler::GetSharedProfilePath(); } const NetworkProfile* profile = @@ -367,10 +367,10 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( return; } - std::string type, security; + std::string type, security_class; service_properties.GetStringWithoutPathExpansion(shill::kTypeProperty, &type); service_properties.GetStringWithoutPathExpansion( - shill::kSecurityProperty, &security); + shill::kSecurityClassProperty, &security_class); bool connectable = false; service_properties.GetBooleanWithoutPathExpansion( shill::kConnectableProperty, &connectable); @@ -436,7 +436,8 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( client_cert_type = client_cert::CONFIG_TYPE_IPSEC; } } - } else if (type == shill::kTypeWifi && security == shill::kSecurity8021x) { + } else if (type == shill::kTypeWifi && + security_class == shill::kSecurity8021x) { client_cert_type = client_cert::CONFIG_TYPE_EAP; } diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc index d0d4b38..bd0f0d7 100644 --- a/chromeos/network/network_state.cc +++ b/chromeos/network/network_state.cc @@ -78,8 +78,8 @@ bool NetworkState::PropertyChanged(const std::string& key, return false; return olp->GetStringWithoutPathExpansion(shill::kPaymentPortalURL, &payment_url_); - } else if (key == shill::kSecurityProperty) { - return GetStringValue(key, value, &security_); + } else if (key == shill::kSecurityClassProperty) { + return GetStringValue(key, value, &security_class_); } else if (key == shill::kEapMethodProperty) { return GetStringValue(key, value, &eap_method_); } else if (key == shill::kNetworkTechnologyProperty) { @@ -153,8 +153,8 @@ void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { // Properties shared by all types. dictionary->SetStringWithoutPathExpansion(shill::kGuidProperty, guid()); - dictionary->SetStringWithoutPathExpansion(shill::kSecurityProperty, - security()); + dictionary->SetStringWithoutPathExpansion(shill::kSecurityClassProperty, + security_class()); if (visible()) { if (!error().empty()) @@ -285,7 +285,7 @@ std::string NetworkState::GetSpecifier() const { return std::string(); } if (type() == shill::kTypeWifi) - return name() + "_" + security_; + return name() + "_" + security_class_; if (!name().empty()) return name(); return type(); // For unnamed networks such as ethernet. diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h index 1b124e2..403daf7 100644 --- a/chromeos/network/network_state.h +++ b/chromeos/network/network_state.h @@ -52,7 +52,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { // Accessors bool visible() const { return visible_; } - const std::string& security() const { return security_; } + const std::string& security_class() const { return security_class_; } const std::string& device_path() const { return device_path_; } const std::string& guid() const { return guid_; } const std::string& profile_path() const { return profile_path_; } @@ -136,7 +136,7 @@ class CHROMEOS_EXPORT NetworkState : public ManagedState { // Network Service properties. Avoid adding any additional properties here. // Instead use NetworkConfigurationHandler::GetProperties() to asynchronously // request properties from Shill. - std::string security_; + std::string security_class_; std::string eap_method_; // Needed for WiFi EAP networks std::string device_path_; std::string guid_; diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc index c118e19..898a82b 100644 --- a/chromeos/network/network_state_handler_unittest.cc +++ b/chromeos/network/network_state_handler_unittest.cc @@ -493,22 +493,22 @@ TEST_F(NetworkStateHandlerTest, ServicePropertyChanged) { const std::string eth1 = kShillManagerClientStubDefaultService; const NetworkState* ethernet = network_state_handler_->GetNetworkState(eth1); ASSERT_TRUE(ethernet); - EXPECT_EQ("", ethernet->security()); + EXPECT_EQ("", ethernet->security_class()); EXPECT_EQ(1, test_observer_->PropertyUpdatesForService(eth1)); - base::StringValue security_value("TestSecurity"); + base::StringValue security_class_value("TestSecurityClass"); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(eth1), - shill::kSecurityProperty, security_value, + shill::kSecurityClassProperty, security_class_value, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); ethernet = network_state_handler_->GetNetworkState(eth1); - EXPECT_EQ("TestSecurity", ethernet->security()); + EXPECT_EQ("TestSecurityClass", ethernet->security_class()); EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(eth1)); // Changing a service to the existing value should not trigger an update. DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(eth1), - shill::kSecurityProperty, security_value, + shill::kSecurityClassProperty, security_class_value, base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(2, test_observer_->PropertyUpdatesForService(eth1)); @@ -639,7 +639,7 @@ TEST_F(NetworkStateHandlerTest, DefaultServiceChanged) { test_observer_->reset_change_counts(); DBusThreadManager::Get()->GetShillServiceClient()->SetProperty( dbus::ObjectPath(wifi1), - shill::kSecurityProperty, base::StringValue("TestSecurity"), + shill::kSecurityClassProperty, base::StringValue("TestSecurityClass"), base::Bind(&base::DoNothing), base::Bind(&ErrorCallbackFunction)); message_loop_.RunUntilIdle(); EXPECT_EQ(1u, test_observer_->default_network_change_count()); diff --git a/chromeos/network/onc/onc_translation_tables.cc b/chromeos/network/onc/onc_translation_tables.cc index 3e22de3a..6d9ade3 100644 --- a/chromeos/network/onc/onc_translation_tables.cc +++ b/chromeos/network/onc/onc_translation_tables.cc @@ -120,7 +120,7 @@ const FieldTranslationEntry wifi_fields[] = { // This field is converted during translation, see onc_translator_*. // { ::onc::wifi::kSSID, shill::kWifiHexSsid}, // This field is converted during translation, see onc_translator_*. - // { ::onc::wifi::kSecurity, shill::kSecurityProperty }, + // { ::onc::wifi::kSecurity, shill::kSecurityClassProperty }, { ::onc::wifi::kSignalStrength, shill::kSignalStrengthProperty}, {NULL}}; @@ -285,14 +285,11 @@ const StringTranslationEntry kVPNTypeTable[] = { { ::onc::vpn::kThirdPartyVpn, shill::kProviderThirdPartyVpn}, {NULL}}; -// The first matching line is chosen. const StringTranslationEntry kWiFiSecurityTable[] = { { ::onc::wifi::kSecurityNone, shill::kSecurityNone}, { ::onc::wifi::kWEP_PSK, shill::kSecurityWep}, { ::onc::wifi::kWPA_PSK, shill::kSecurityPsk}, { ::onc::wifi::kWPA_EAP, shill::kSecurity8021x}, - { ::onc::wifi::kWPA_PSK, shill::kSecurityRsn}, - { ::onc::wifi::kWPA_PSK, shill::kSecurityWpa}, {NULL}}; const StringTranslationEntry kEAPOuterTable[] = { diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc index fbfe16e..c9d4151 100644 --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc @@ -201,7 +201,7 @@ void LocalTranslator::TranslateWiFi() { if (onc_object_->GetStringWithoutPathExpansion( ::onc::wifi::kSecurity, &security)) { TranslateWithTableAndSet(security, kWiFiSecurityTable, - shill::kSecurityProperty); + shill::kSecurityClassProperty); } std::string ssid; diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc index 9ef19e9..1e7885f 100644 --- a/chromeos/network/onc/onc_translator_shill_to_onc.cc +++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc @@ -313,8 +313,9 @@ void ShillToONCTranslator::TranslateVPN() { } void ShillToONCTranslator::TranslateWiFiWithState() { - TranslateWithTableAndSet( - shill::kSecurityProperty, kWiFiSecurityTable, ::onc::wifi::kSecurity); + TranslateWithTableAndSet(shill::kSecurityClassProperty, + kWiFiSecurityTable, + ::onc::wifi::kSecurity); std::string ssid = shill_property_util::GetSSIDFromProperties( *shill_dictionary_, NULL /* ignore unknown encoding */); if (!ssid.empty()) diff --git a/chromeos/network/onc/onc_translator_unittest.cc b/chromeos/network/onc/onc_translator_unittest.cc index b796576..5d4f3ce 100644 --- a/chromeos/network/onc/onc_translator_unittest.cc +++ b/chromeos/network/onc/onc_translator_unittest.cc @@ -97,8 +97,6 @@ INSTANTIATE_TEST_CASE_P( "translation_of_shill_ethernet_with_ipconfig.onc"), std::make_pair("shill_wifi_clientcert.json", "translation_of_shill_wifi_clientcert.onc"), - std::make_pair("shill_wifi_wpa1.json", - "translation_of_shill_wifi_wpa1.onc"), std::make_pair("shill_output_l2tpipsec.json", "translation_of_shill_l2tpipsec.onc"), std::make_pair("shill_output_openvpn.json", diff --git a/chromeos/network/shill_property_util.cc b/chromeos/network/shill_property_util.cc index 405de1e3..75a94f7 100644 --- a/chromeos/network/shill_property_util.cc +++ b/chromeos/network/shill_property_util.cc @@ -57,16 +57,6 @@ bool CopyStringFromDictionary(const base::DictionaryValue& source, return true; } -// This is the same normalization that Shill applies to security types for the -// sake of comparing/identifying WiFi networks. See Shill's -// WiFiService::GetSecurityClass. -std::string GetSecurityClass(const std::string& security) { - if (security == shill::kSecurityRsn || security == shill::kSecurityWpa) - return shill::kSecurityPsk; - else - return security; -} - } // namespace void SetSSID(const std::string ssid, base::DictionaryValue* properties) { @@ -255,15 +245,9 @@ bool CopyIdentifyingProperties(const base::DictionaryValue& service_properties, success &= !type.empty(); dest->SetStringWithoutPathExpansion(shill::kTypeProperty, type); if (type == shill::kTypeWifi) { - std::string security; - service_properties.GetStringWithoutPathExpansion(shill::kSecurityProperty, - &security); - if (security.empty()) { - success = false; - } else { - dest->SetStringWithoutPathExpansion(shill::kSecurityProperty, - GetSecurityClass(security)); - } + success &= + CopyStringFromDictionary( + service_properties, shill::kSecurityClassProperty, dest); success &= CopyStringFromDictionary(service_properties, shill::kWifiHexSsid, dest); success &= CopyStringFromDictionary( diff --git a/chromeos/test/data/network/policy/shill_disallow_autoconnect_on_unmanaged_wifi2.json b/chromeos/test/data/network/policy/shill_disallow_autoconnect_on_unmanaged_wifi2.json index d21b704..d03b86c 100644 --- a/chromeos/test/data/network/policy/shill_disallow_autoconnect_on_unmanaged_wifi2.json +++ b/chromeos/test/data/network/policy/shill_disallow_autoconnect_on_unmanaged_wifi2.json @@ -2,7 +2,7 @@ "AutoConnect": false, "Mode": "managed", "Profile": "/profile/user1/shill", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "WiFi.HexSSID": "7769666932" // "wifi2" } diff --git a/chromeos/test/data/network/policy/shill_managed_wifi1_rsn.json b/chromeos/test/data/network/policy/shill_managed_wifi1_rsn.json deleted file mode 100644 index 1ab8bb9..0000000 --- a/chromeos/test/data/network/policy/shill_managed_wifi1_rsn.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "AutoConnect": true, - "GUID": "policy_wifi1", - "Mode": "managed", - "Passphrase": "user's passphrase", - "Profile": "/profile/user1/shill", - "WiFi.HexSSID": "7769666931", // "wifi1" - "Security": "rsn", - "Type": "wifi", - "UIData": "{\"onc_source\":\"user_policy\",\"user_settings\":{\"WiFi\":{\"Passphrase\":\"FAKE_CREDENTIAL_VPaJDV9x\"}}}" -} diff --git a/chromeos/test/data/network/policy/shill_policy_autoconnect_on_unconfigured_wifi1.json b/chromeos/test/data/network/policy/shill_policy_autoconnect_on_unconfigured_wifi1.json index 219af79..178e76b 100644 --- a/chromeos/test/data/network/policy/shill_policy_autoconnect_on_unconfigured_wifi1.json +++ b/chromeos/test/data/network/policy/shill_policy_autoconnect_on_unconfigured_wifi1.json @@ -5,7 +5,7 @@ "Mode": "managed", "Passphrase": "policy's passphrase", "Profile": "/profile/user1/shill", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "UIData": "{\"onc_source\":\"user_policy\"}", "WiFi.HexSSID": "7769666931" // "wifi1" diff --git a/chromeos/test/data/network/policy/shill_policy_on_unconfigured_wifi1.json b/chromeos/test/data/network/policy/shill_policy_on_unconfigured_wifi1.json index d998ba9..68f4564 100644 --- a/chromeos/test/data/network/policy/shill_policy_on_unconfigured_wifi1.json +++ b/chromeos/test/data/network/policy/shill_policy_on_unconfigured_wifi1.json @@ -3,7 +3,7 @@ "Mode": "managed", "Passphrase": "policy's passphrase", "Profile": "/profile/user1/shill", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "UIData": "{\"onc_source\":\"user_policy\"}", "WiFi.HexSSID": "7769666931" // "wifi1" diff --git a/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1.json b/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1.json index 7c9c4bc..5a8f5f2 100644 --- a/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1.json +++ b/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1.json @@ -4,7 +4,7 @@ "Passphrase": "user's passphrase", "Profile": "/profile/user1/shill", "WiFi.HexSSID": "7769666931", // "wifi1" - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "UIData": "{\"onc_source\":\"user_policy\",\"user_settings\":{\"WiFi\":{\"Passphrase\":\"FAKE_CREDENTIAL_VPaJDV9x\"}}}" } diff --git a/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1_wo_uidata.json b/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1_wo_uidata.json deleted file mode 100644 index 9df16c0..0000000 --- a/chromeos/test/data/network/policy/shill_policy_on_unmanaged_wifi1_wo_uidata.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "GUID": "policy_wifi1", - "Mode": "managed", - "Passphrase": "user's passphrase", - "Profile": "/profile/user1/shill", - "Security": "psk", - "Type": "wifi", - "UIData": "{\"onc_source\":\"user_policy\"}}", - "WiFi.HexSSID": "7769666931" // "wifi1" -} diff --git a/chromeos/test/data/network/policy/shill_unmanaged_wifi1.json b/chromeos/test/data/network/policy/shill_unmanaged_wifi1.json index a83b2ed..9467416 100644 --- a/chromeos/test/data/network/policy/shill_unmanaged_wifi1.json +++ b/chromeos/test/data/network/policy/shill_unmanaged_wifi1.json @@ -4,7 +4,7 @@ "Passphrase": "user's passphrase", "Profile": "/profile/user1/shill", "WiFi.HexSSID": "7769666931", // "wifi1" - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "UIData": "{\"user_settings\":{\"WiFi\":{\"Passphrase\":\"user's passphrase\"}}}" } diff --git a/chromeos/test/data/network/policy/shill_unmanaged_wifi1_wo_uidata.json b/chromeos/test/data/network/policy/shill_unmanaged_wifi1_wo_uidata.json deleted file mode 100644 index 6028b6b..0000000 --- a/chromeos/test/data/network/policy/shill_unmanaged_wifi1_wo_uidata.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "GUID": "{unmanaged_user_wifi1}", - "Mode": "managed", - "Passphrase": "user's passphrase", - "Profile": "/profile/user1/shill", - "Security": "psk", - "Type": "wifi", - "WiFi.HexSSID": "7769666931" // "wifi1" -} diff --git a/chromeos/test/data/network/policy/shill_unmanaged_wifi2.json b/chromeos/test/data/network/policy/shill_unmanaged_wifi2.json index 74b3d63..4b26449 100644 --- a/chromeos/test/data/network/policy/shill_unmanaged_wifi2.json +++ b/chromeos/test/data/network/policy/shill_unmanaged_wifi2.json @@ -3,7 +3,7 @@ "Mode": "managed", "Passphrase": "user's passphrase", "Profile": "/profile/user1/shill", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "WiFi.HexSSID": "7769666932" // "wifi2" } diff --git a/chromeos/test/data/network/shill_wifi_clientcert.json b/chromeos/test/data/network/shill_wifi_clientcert.json index 0015800..8a0bd7a 100644 --- a/chromeos/test/data/network/shill_wifi_clientcert.json +++ b/chromeos/test/data/network/shill_wifi_clientcert.json @@ -5,7 +5,7 @@ "GUID": "{77db0089-0bc8-4358-929c-123xcv}", "Mode": "managed", "SaveCredentials": true, - "Security": "802_1x", + "SecurityClass": "802_1x", "Type": "wifi", "WiFi.HexSSID": "536F6D65576966692D5859" // "SomeWifi-XY" } diff --git a/chromeos/test/data/network/shill_wifi_clientref.json b/chromeos/test/data/network/shill_wifi_clientref.json index 551cda8..65dfbdc 100644 --- a/chromeos/test/data/network/shill_wifi_clientref.json +++ b/chromeos/test/data/network/shill_wifi_clientref.json @@ -5,7 +5,7 @@ "GUID": "{77db0089-0bc8-4358-929c-123xcv}", "Mode": "managed", "SaveCredentials": true, - "Security": "802_1x", + "SecurityClass": "802_1x", "Type": "wifi", "WiFi.HexSSID": "536F6D65576966692D5859" // "SomeWifi-XY" } diff --git a/chromeos/test/data/network/shill_wifi_dhcp.json b/chromeos/test/data/network/shill_wifi_dhcp.json index ccbe750..1e9b269 100644 --- a/chromeos/test/data/network/shill_wifi_dhcp.json +++ b/chromeos/test/data/network/shill_wifi_dhcp.json @@ -4,7 +4,7 @@ "Mode": "managed", "StaticIPConfig": {}, "Passphrase": "some passphrase", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "WiFi.HexSSID": "576966695769746844484350", // "WifiWithDHCP" } diff --git a/chromeos/test/data/network/shill_wifi_psk.json b/chromeos/test/data/network/shill_wifi_psk.json index 9969879..2e48e7d 100644 --- a/chromeos/test/data/network/shill_wifi_psk.json +++ b/chromeos/test/data/network/shill_wifi_psk.json @@ -3,7 +3,7 @@ "GUID": "{64c4f86b-cf6a-4e4a-8eff-456def}", "Mode": "managed", "Passphrase": "some passphrase", - "Security": "psk", + "SecurityClass": "psk", "Type": "wifi", "WiFi.HexSSID": "4F70656E577274", // "OpenWrt" "WiFi.HiddenSSID": false, diff --git a/chromeos/test/data/network/shill_wifi_with_state.json b/chromeos/test/data/network/shill_wifi_with_state.json index 9a2fe93..a152675 100644 --- a/chromeos/test/data/network/shill_wifi_with_state.json +++ b/chromeos/test/data/network/shill_wifi_with_state.json @@ -7,7 +7,7 @@ "Passphrase": "some passphrase", "Priority": 1, "Profile": "/profile/someuser", - "Security": "psk", + "SecurityClass": "psk", "State": "idle", "Strength": 10, "Type": "wifi", diff --git a/chromeos/test/data/network/shill_wifi_wpa1.json b/chromeos/test/data/network/shill_wifi_wpa1.json deleted file mode 100644 index db1e353..0000000 --- a/chromeos/test/data/network/shill_wifi_wpa1.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "GUID":"{64c4f86b-cf6a-4e4a-8eff-456def}", - "Mode":"managed", - "Name":"OpenWrt", - "Passphrase":"some passphrase", - "Security":"wpa", - "Type":"wifi", - "WiFi.HexSSID": "4F70656E577274" // "OpenWrt" -} diff --git a/chromeos/test/data/network/translation_of_shill_wifi_wpa1.onc b/chromeos/test/data/network/translation_of_shill_wifi_wpa1.onc deleted file mode 100644 index c23df0f..0000000 --- a/chromeos/test/data/network/translation_of_shill_wifi_wpa1.onc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "GUID":"{64c4f86b-cf6a-4e4a-8eff-456def}", - "Name":"OpenWrt", - "Type":"WiFi", - "WiFi":{ - "Passphrase":"some passphrase", - "SSID":"OpenWrt", - "Security":"WPA-PSK" - } -} diff --git a/components/wifi_sync/network_state_helper_chromeos.cc b/components/wifi_sync/network_state_helper_chromeos.cc index 54b8535..5cf6f18 100644 --- a/components/wifi_sync/network_state_helper_chromeos.cc +++ b/components/wifi_sync/network_state_helper_chromeos.cc @@ -30,16 +30,14 @@ WifiCredential::CredentialSet GetWifiCredentialsForShillProfile( if (network->profile_path() != shill_profile_path) continue; - // TODO(quiche): Switch away from network->security(), once we have - // a security_class() field in NetworkState. - // // TODO(quiche): Fill in the actual passphrase via an asynchronous // call to a chromeos::NetworkConfigurationHandler instance's // GetProperties method. credentials.insert( - WifiCredential(network->raw_ssid(), - WifiSecurityClassFromShillSecurity(network->security()), - "" /* empty passphrase */)); + WifiCredential( + network->raw_ssid(), + WifiSecurityClassFromShillSecurity(network->security_class()), + "" /* empty passphrase */)); } return credentials; } diff --git a/ui/chromeos/network/network_connect.cc b/ui/chromeos/network/network_connect.cc index e1d9856..a7cb0ae 100644 --- a/ui/chromeos/network/network_connect.cc +++ b/ui/chromeos/network/network_connect.cc @@ -136,7 +136,7 @@ void NetworkConnectImpl::HandleUnconfiguredNetwork( if (network->type() == shill::kTypeWifi) { // Only show the config view for secure networks, otherwise do nothing. - if (network->security() != shill::kSecurityNone) { + if (network->security_class() != shill::kSecurityNone) { delegate_->ShowNetworkConfigure(service_path); } return; @@ -377,7 +377,7 @@ void NetworkConnectImpl::ConnectToNetwork(const std::string& service_path) { NET_LOG_USER("ConnectToNetwork", service_path); const NetworkState* network = GetNetworkState(service_path); if (network) { - if (!network->error().empty() && !network->security().empty()) { + if (!network->error().empty() && !network->security_class().empty()) { NET_LOG_USER("Configure: " + network->error(), service_path); // If the network is in an error state, show the configuration UI // directly to avoid a spurious notification. diff --git a/ui/chromeos/network/network_icon.cc b/ui/chromeos/network/network_icon.cc index ca06e2c..d41550a 100644 --- a/ui/chromeos/network/network_icon.cc +++ b/ui/chromeos/network/network_icon.cc @@ -674,7 +674,7 @@ void NetworkIconImpl::GetBadges(const NetworkState* network, Badges* badges) { const std::string& type = network->type(); if (type == shill::kTypeWifi) { - if (network->security() != shill::kSecurityNone && + if (network->security_class() != shill::kSecurityNone && IconTypeIsDark(icon_type_)) { badges->bottom_right = rb.GetImageSkiaNamed( IDR_AURA_UBER_TRAY_NETWORK_SECURE_DARK); diff --git a/ui/chromeos/network/network_state_notifier_unittest.cc b/ui/chromeos/network/network_state_notifier_unittest.cc index 078b248c..89b27b8 100644 --- a/ui/chromeos/network/network_state_notifier_unittest.cc +++ b/ui/chromeos/network/network_state_notifier_unittest.cc @@ -87,7 +87,7 @@ class NetworkStateNotifierTest : public testing::Test { service_test->AddService("/service/wifi1", "wifi1_guid", "wifi1", shill::kTypeWifi, shill::kStateIdle, add_to_visible); - service_test->SetServiceProperty("wifi1", shill::kSecurityProperty, + service_test->SetServiceProperty("wifi1", shill::kSecurityClassProperty, base::StringValue(shill::kSecurityWep)); service_test->SetServiceProperty("wifi1", shill::kConnectableProperty, base::FundamentalValue(true)); |