summaryrefslogtreecommitdiffstats
path: root/service/java/com/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-05-12 02:43:06 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-12 02:43:06 +0000
commit050acb5eec918f3f0a47f0955815398c15f10ca8 (patch)
tree94527f56b1e031ee2a076a03a3cb5ac3e6caedba /service/java/com/android
parent8b5cc8afd5b23d70681f0880a7136f0a0646cdb0 (diff)
parent194152febb8c5b726a051469f7368f271dceaaee (diff)
downloadandroid_frameworks_opt_net_wifi-050acb5eec918f3f0a47f0955815398c15f10ca8.tar.gz
android_frameworks_opt_net_wifi-050acb5eec918f3f0a47f0955815398c15f10ca8.tar.bz2
android_frameworks_opt_net_wifi-050acb5eec918f3f0a47f0955815398c15f10ca8.zip
Merge "[WPA3] Fix connectivity issues with PSK-SAE Transtion mode" into qt-dev
Diffstat (limited to 'service/java/com/android')
-rw-r--r--service/java/com/android/server/wifi/ScanResultMatchInfo.java29
-rw-r--r--service/java/com/android/server/wifi/util/ScanResultUtil.java8
2 files changed, 34 insertions, 3 deletions
diff --git a/service/java/com/android/server/wifi/ScanResultMatchInfo.java b/service/java/com/android/server/wifi/ScanResultMatchInfo.java
index ffbd6346c..5eb9d4d64 100644
--- a/service/java/com/android/server/wifi/ScanResultMatchInfo.java
+++ b/service/java/com/android/server/wifi/ScanResultMatchInfo.java
@@ -34,6 +34,10 @@ public class ScanResultMatchInfo {
* Security Type of the network.
*/
public @WifiConfiguration.SecurityType int networkType;
+ /**
+ * Special flag for PSK-SAE in transition mode
+ */
+ public boolean pskSaeInTransitionMode;
/**
* Fetch network type from network configuration.
@@ -101,6 +105,13 @@ public class ScanResultMatchInfo {
// either have a hex string or quoted ASCII string SSID.
info.networkSsid = ScanResultUtil.createQuotedSSID(scanResult.SSID);
info.networkType = getNetworkType(scanResult);
+ if (info.networkType == WifiConfiguration.SECURITY_TYPE_SAE) {
+ // Note that scan result util will always choose the highest security protocol.
+ info.pskSaeInTransitionMode =
+ ScanResultUtil.isScanResultForPskSaeTransitionNetwork(scanResult);
+ } else {
+ info.pskSaeInTransitionMode = false;
+ }
return info;
}
@@ -112,13 +123,25 @@ public class ScanResultMatchInfo {
return false;
}
ScanResultMatchInfo other = (ScanResultMatchInfo) otherObj;
- return Objects.equals(networkSsid, other.networkSsid)
- && networkType == other.networkType;
+ if (!Objects.equals(networkSsid, other.networkSsid)) {
+ return false;
+ }
+ boolean networkTypeEquals;
+
+ // Detect <SSID, PSK+SAE> scan result and say it is equal to <SSID, PSK> configuration
+ if (other.pskSaeInTransitionMode && networkType == WifiConfiguration.SECURITY_TYPE_PSK
+ || (pskSaeInTransitionMode
+ && other.networkType == WifiConfiguration.SECURITY_TYPE_PSK)) {
+ networkTypeEquals = true;
+ } else {
+ networkTypeEquals = networkType == other.networkType;
+ }
+ return networkTypeEquals;
}
@Override
public int hashCode() {
- return Objects.hash(networkSsid, networkType);
+ return Objects.hash(networkSsid);
}
@Override
diff --git a/service/java/com/android/server/wifi/util/ScanResultUtil.java b/service/java/com/android/server/wifi/util/ScanResultUtil.java
index f92c2d532..a9da3e454 100644
--- a/service/java/com/android/server/wifi/util/ScanResultUtil.java
+++ b/service/java/com/android/server/wifi/util/ScanResultUtil.java
@@ -95,6 +95,14 @@ public class ScanResultUtil {
}
/**
+ * Helper method to check if the provided |scanResult| corresponds to PSK-SAE transition
+ * network. This checks if the provided capabilities string contains SAE or not.
+ */
+ public static boolean isScanResultForPskSaeTransitionNetwork(ScanResult scanResult) {
+ return scanResult.capabilities.contains("PSK+SAE");
+ }
+
+ /**
* Helper method to check if the provided |scanResult| corresponds to an open network or not.
* This checks if the provided capabilities string does not contain either of WEP, PSK, SAE
* or EAP encryption types or not.