diff options
author | Hai Shalom <haishalom@google.com> | 2019-05-08 13:27:23 -0700 |
---|---|---|
committer | Hai Shalom <haishalom@google.com> | 2019-05-09 15:14:14 -0700 |
commit | 194152febb8c5b726a051469f7368f271dceaaee (patch) | |
tree | 3fe837c6a1aa57f424c03b1dcd674481e17ead94 /tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java | |
parent | 63dec560c331910d929f618add9e913601f2e675 (diff) | |
download | android_frameworks_opt_net_wifi-194152febb8c5b726a051469f7368f271dceaaee.tar.gz android_frameworks_opt_net_wifi-194152febb8c5b726a051469f7368f271dceaaee.tar.bz2 android_frameworks_opt_net_wifi-194152febb8c5b726a051469f7368f271dceaaee.zip |
[WPA3] Fix connectivity issues with PSK-SAE Transtion mode
Fix two reported issues regarding PSK-SAE transition mode:
1. When phone supports SAE, creating a manual saved network with PSK
and manually connecting would cause the phone to connect but Settings
does not display any connected AP. Phone would not autoconnect.
2. When phone doesn't support SAE, phone cannot connect to an AP in
PSK-SAE Transition mode because the framework always targets the highest
security.
Bug: 132278271
Test: Connect to WPA2 network
Test: Connect to WPA3 network (w/capable phone)
Test: Connect to WPA2/3 Transition w/SAE capable phone
Test: Connect to WPA2/3 Transition w/SAE not-capable phone
Test: atest ScanResultMatchInfoTest
Change-Id: Icc94039a4b31742ce7f3f16e9fe653bd402a5150
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java index c114aa10d..056df7c37 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiConfigurationTestUtil.java @@ -300,6 +300,12 @@ public class WifiConfigurationTestUtil { return configuration; } + public static WifiConfiguration createSaeNetwork(String ssid) { + WifiConfiguration configuration = + generateWifiConfig(TEST_NETWORK_ID, TEST_UID, ssid, true, true, null, + null, SECURITY_SAE); + return configuration; + } public static WifiConfiguration createPskHiddenNetwork() { WifiConfiguration configuration = createPskNetwork(); @@ -500,6 +506,15 @@ public class WifiConfigurationTestUtil { } /** + * Gets scan result capabilities for a WPA2/WPA3-Transition mode network configuration + */ + private static String + getScanResultCapsForWpa2Wpa3TransitionNetwork(WifiConfiguration configuration) { + String caps = "[RSN-PSK+SAE-CCMP]"; + return caps; + } + + /** * Creates a scan detail corresponding to the provided network and given BSSID, etc. */ public static ScanDetail createScanDetailForNetwork( @@ -511,6 +526,19 @@ public class WifiConfigurationTestUtil { } /** + * Creates a scan detail corresponding to the provided network and given BSSID, but sets + * the capabilities to WPA2/WPA3-Transition mode network. + */ + public static ScanDetail createScanDetailForWpa2Wpa3TransitionModeNetwork( + WifiConfiguration configuration, String bssid, int level, int frequency, + long tsf, long seen) { + String caps = getScanResultCapsForWpa2Wpa3TransitionNetwork(configuration); + WifiSsid ssid = WifiSsid.createFromAsciiEncoded(configuration.getPrintableSsid()); + return new ScanDetail(ssid, bssid, caps, level, frequency, tsf, seen); + } + + + /** * Asserts that the 2 WifiConfigurations are equal in the elements saved for both backup/restore * and config store. */ |