summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-06-23 07:11:10 (GMT)
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-06-23 07:11:10 (GMT)
commitacae781862cb6146b629af2e192e27bbbafbcc38 (patch)
tree26dcbbbd0709376c34a62dd49b902afb161f1b28
parent4fe423f369a66dd415862f5cdf47e14583ecd072 (diff)
parent1e31a57f290a2053077e5277f1c98c0fb1d26d69 (diff)
downloadandroid_frameworks_opt_net_wifi-lineage-15.0.zip
android_frameworks_opt_net_wifi-lineage-15.0.tar.gz
android_frameworks_opt_net_wifi-lineage-15.0.tar.bz2
release-request-160c4b31-7fa0-4e2b-aabe-85380836a1ce-for-git_oc-release-4129081 snap-temp-L15300000077039010lineage-15.0
Change-Id: Ie0cee61ab29b90df6f7b141d2b937f1131fef95f
-rw-r--r--libwifi_hal/Android.mk4
-rw-r--r--service/java/com/android/server/wifi/WifiConfigManager.java4
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java44
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java1
4 files changed, 50 insertions, 3 deletions
diff --git a/libwifi_hal/Android.mk b/libwifi_hal/Android.mk
index b06171f..1179a09 100644
--- a/libwifi_hal/Android.mk
+++ b/libwifi_hal/Android.mk
@@ -86,10 +86,12 @@ include $(BUILD_STATIC_LIBRARY)
# Pick a vendor provided HAL implementation library.
# ============================================================
LIB_WIFI_HAL := libwifi-hal-fallback
+VENDOR_LOCAL_SHARED_LIBRARIES :=
ifeq ($(BOARD_WLAN_DEVICE), bcmdhd)
LIB_WIFI_HAL := libwifi-hal-bcm
else ifeq ($(BOARD_WLAN_DEVICE), qcwcn)
LIB_WIFI_HAL := libwifi-hal-qcom
+ VENDOR_LOCAL_SHARED_LIBRARIES := libcld80211
else ifeq ($(BOARD_WLAN_DEVICE), mrvl)
# this is commented because none of the nexus devices
# that sport Marvell's wifi have support for HAL
@@ -116,7 +118,7 @@ LOCAL_SHARED_LIBRARIES := \
liblog \
libnl \
libutils \
- libcld80211
+ $(VENDOR_LOCAL_SHARED_LIBRARIES)
LOCAL_SRC_FILES := \
driver_tool.cpp \
hal_tool.cpp
diff --git a/service/java/com/android/server/wifi/WifiConfigManager.java b/service/java/com/android/server/wifi/WifiConfigManager.java
index 4b2bb1c..25a5a20 100644
--- a/service/java/com/android/server/wifi/WifiConfigManager.java
+++ b/service/java/com/android/server/wifi/WifiConfigManager.java
@@ -820,8 +820,8 @@ public class WifiConfigManager {
// Copy over the |WifiEnterpriseConfig| parameters if set.
if (externalConfig.enterpriseConfig != null) {
- internalConfig.enterpriseConfig =
- new WifiEnterpriseConfig(externalConfig.enterpriseConfig);
+ internalConfig.enterpriseConfig.copyFromExternal(
+ externalConfig.enterpriseConfig, PASSWORD_MASK);
}
}
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
index e85686f..9fa67a0 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigManagerTest.java
@@ -1381,6 +1381,50 @@ public class WifiConfigManagerTest {
}
/**
+ * Verifies that if the app sends back the masked passwords in an update, we ignore it.
+ */
+ @Test
+ public void testUpdateIgnoresMaskedPasswords() {
+ WifiConfiguration someRandomNetworkWithAllMaskedFields =
+ WifiConfigurationTestUtil.createEapNetwork();
+ someRandomNetworkWithAllMaskedFields.wepKeys = WifiConfigurationTestUtil.TEST_WEP_KEYS;
+ someRandomNetworkWithAllMaskedFields.preSharedKey = WifiConfigurationTestUtil.TEST_PSK;
+ someRandomNetworkWithAllMaskedFields.enterpriseConfig.setPassword(
+ WifiConfigurationTestUtil.TEST_EAP_PASSWORD);
+
+ NetworkUpdateResult result =
+ verifyAddNetworkToWifiConfigManager(someRandomNetworkWithAllMaskedFields);
+
+ // All of these passwords must be masked in this retrieved network config.
+ WifiConfiguration retrievedNetworkWithMaskedPassword =
+ mWifiConfigManager.getConfiguredNetwork(result.getNetworkId());
+ assertPasswordsMaskedInWifiConfiguration(retrievedNetworkWithMaskedPassword);
+ // Ensure that the passwords are present internally.
+ WifiConfiguration retrievedNetworkWithPassword =
+ mWifiConfigManager.getConfiguredNetworkWithPassword(result.getNetworkId());
+ assertEquals(someRandomNetworkWithAllMaskedFields.preSharedKey,
+ retrievedNetworkWithPassword.preSharedKey);
+ assertEquals(someRandomNetworkWithAllMaskedFields.wepKeys,
+ retrievedNetworkWithPassword.wepKeys);
+ assertEquals(someRandomNetworkWithAllMaskedFields.enterpriseConfig.getPassword(),
+ retrievedNetworkWithPassword.enterpriseConfig.getPassword());
+
+ // Now update the same network config using the masked config.
+ verifyUpdateNetworkToWifiConfigManager(retrievedNetworkWithMaskedPassword);
+
+ // Retrieve the network config with password and ensure that they have not been overwritten
+ // with *.
+ retrievedNetworkWithPassword =
+ mWifiConfigManager.getConfiguredNetworkWithPassword(result.getNetworkId());
+ assertEquals(someRandomNetworkWithAllMaskedFields.preSharedKey,
+ retrievedNetworkWithPassword.preSharedKey);
+ assertEquals(someRandomNetworkWithAllMaskedFields.wepKeys,
+ retrievedNetworkWithPassword.wepKeys);
+ assertEquals(someRandomNetworkWithAllMaskedFields.enterpriseConfig.getPassword(),
+ retrievedNetworkWithPassword.enterpriseConfig.getPassword());
+ }
+
+ /**
* Verifies the ordering of network list generated using
* {@link WifiConfigManager#retrievePnoNetworkList()}.
*/
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
index b53732a..f7bf5b0 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java
@@ -65,6 +65,7 @@ public class WifiConfigurationTestUtil {
public static final String[] TEST_WEP_KEYS =
{"\"WifiConfigurationTestUtilWep1\"", "\"WifiConfigurationTestUtilWep2\"",
"45342312ab", "45342312ab45342312ab34ac12"};
+ public static final String TEST_EAP_PASSWORD = "WifiConfigurationTestUtilEapPassword";
public static final int TEST_WEP_TX_KEY_INDEX = 1;
public static final String TEST_FQDN = "WifiConfigurationTestUtilFQDN";
public static final String TEST_PROVIDER_FRIENDLY_NAME =