diff options
author | Roshan Pius <rpius@google.com> | 2017-06-06 14:51:19 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2017-06-06 23:39:10 +0000 |
commit | eb6343516fb91c3f7651e5979e047306aaf04554 (patch) | |
tree | 37215411a74ac5bd95f9acd711adc5b61428098e /tests | |
parent | 2d02c0b588eb19935ad87b8dae9d6a9839e667c2 (diff) |
WifiConfigurationUtil: Ignore masked passwords
This is the case of apps retrieving WifiConfiguration from WifiManager
API's and passing it back to use for a network update. This is already
ignored in WifiConfigManager's update handling.
Bug: 62385845
Test: Unit tests
Test: Able to force connection to existing saved PSK network.
Change-Id: I0277dcca401335db21ad0f360f044e9634956829
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java index 8c1c307ce..40e7d4f28 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationUtilTest.java @@ -215,6 +215,18 @@ public class WifiConfigurationUtilTest { } /** + * Verify that the validate method validates WifiConfiguration with masked psk string. + */ + @Test + public void testValidatePositiveCases_MaskedPskString() { + WifiConfiguration config = WifiConfigurationTestUtil.createPskNetwork(); + assertTrue(WifiConfigurationUtil.validate(config)); + + config.preSharedKey = WifiConfigurationUtil.PASSWORD_MASK; + assertTrue(WifiConfigurationUtil.validate(config)); + } + + /** * Verify that the validate method fails to validate WifiConfiguration with bad ssid length. */ @Test |