summaryrefslogtreecommitdiffstats
path: root/service/java/com/android
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2019-05-14 13:57:08 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-05-14 13:57:08 +0000
commit2799685d3f49cb74c0ed7353ce6d677908cc6fdd (patch)
tree5b410e7495e45f3e587ffa62ae05dc0283f767d3 /service/java/com/android
parentbb7edf7945cc575f4a42ac6820c3a4da3e0eaf49 (diff)
parentb788af3376c4b676795f04c0092d139780c664a9 (diff)
downloadandroid_frameworks_opt_net_wifi-2799685d3f49cb74c0ed7353ce6d677908cc6fdd.tar.gz
android_frameworks_opt_net_wifi-2799685d3f49cb74c0ed7353ce6d677908cc6fdd.tar.bz2
android_frameworks_opt_net_wifi-2799685d3f49cb74c0ed7353ce6d677908cc6fdd.zip
Merge "[OWE] Support OWE in transition mode" into qt-dev
Diffstat (limited to 'service/java/com/android')
-rw-r--r--service/java/com/android/server/wifi/ScanResultMatchInfo.java18
-rw-r--r--service/java/com/android/server/wifi/util/InformationElementUtil.java5
-rw-r--r--service/java/com/android/server/wifi/util/ScanResultUtil.java10
3 files changed, 28 insertions, 5 deletions
diff --git a/service/java/com/android/server/wifi/ScanResultMatchInfo.java b/service/java/com/android/server/wifi/ScanResultMatchInfo.java
index 5eb9d4d64..b3d10cc38 100644
--- a/service/java/com/android/server/wifi/ScanResultMatchInfo.java
+++ b/service/java/com/android/server/wifi/ScanResultMatchInfo.java
@@ -38,6 +38,10 @@ public class ScanResultMatchInfo {
* Special flag for PSK-SAE in transition mode
*/
public boolean pskSaeInTransitionMode;
+ /**
+ * Special flag for OWE in transition mode
+ */
+ public boolean oweInTransitionMode;
/**
* Fetch network type from network configuration.
@@ -105,12 +109,16 @@ public class ScanResultMatchInfo {
// either have a hex string or quoted ASCII string SSID.
info.networkSsid = ScanResultUtil.createQuotedSSID(scanResult.SSID);
info.networkType = getNetworkType(scanResult);
+ info.oweInTransitionMode = false;
+ info.pskSaeInTransitionMode = false;
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;
+ } else if (info.networkType == WifiConfiguration.SECURITY_TYPE_OWE) {
+ // Note that scan result util will always choose OWE.
+ info.oweInTransitionMode =
+ ScanResultUtil.isScanResultForOweTransitionNetwork(scanResult);
}
return info;
}
@@ -133,6 +141,12 @@ public class ScanResultMatchInfo {
|| (pskSaeInTransitionMode
&& other.networkType == WifiConfiguration.SECURITY_TYPE_PSK)) {
networkTypeEquals = true;
+ } else if ((networkType == WifiConfiguration.SECURITY_TYPE_OPEN
+ && other.oweInTransitionMode) || (oweInTransitionMode
+ && other.networkType == WifiConfiguration.SECURITY_TYPE_OPEN)) {
+ // Special case we treat Enhanced Open and Open as equals. This is done to support the
+ // case where a saved network is Open but we found an OWE in transition network.
+ networkTypeEquals = true;
} else {
networkTypeEquals = networkType == other.networkType;
}
diff --git a/service/java/com/android/server/wifi/util/InformationElementUtil.java b/service/java/com/android/server/wifi/util/InformationElementUtil.java
index 994cd2d65..03a3c18f0 100644
--- a/service/java/com/android/server/wifi/util/InformationElementUtil.java
+++ b/service/java/com/android/server/wifi/util/InformationElementUtil.java
@@ -713,7 +713,7 @@ public class InformationElementUtil {
owePairwiseCipher.add(ScanResult.CIPHER_CCMP);
pairwiseCipher.add(owePairwiseCipher);
ArrayList<Integer> oweKeyManagement = new ArrayList<>();
- oweKeyManagement.add(ScanResult.KEY_MGMT_OWE);
+ oweKeyManagement.add(ScanResult.KEY_MGMT_OWE_TRANSITION);
keyManagement.add(oweKeyManagement);
}
}
@@ -731,7 +731,6 @@ public class InformationElementUtil {
}
}
-
private String protocolToString(int protocol) {
switch (protocol) {
case ScanResult.PROTOCOL_NONE:
@@ -763,6 +762,8 @@ public class InformationElementUtil {
return "PSK-SHA256";
case ScanResult.KEY_MGMT_OWE:
return "OWE";
+ case ScanResult.KEY_MGMT_OWE_TRANSITION:
+ return "OWE_TRANSITION";
case ScanResult.KEY_MGMT_SAE:
return "SAE";
case ScanResult.KEY_MGMT_FT_SAE:
diff --git a/service/java/com/android/server/wifi/util/ScanResultUtil.java b/service/java/com/android/server/wifi/util/ScanResultUtil.java
index a9da3e454..39e9d2c40 100644
--- a/service/java/com/android/server/wifi/util/ScanResultUtil.java
+++ b/service/java/com/android/server/wifi/util/ScanResultUtil.java
@@ -87,6 +87,14 @@ public class ScanResultUtil {
}
/**
+ * Helper method to check if the provided |scanResult| corresponds to OWE transition network.
+ * This checks if the provided capabilities string contains OWE_TRANSITION or not.
+ */
+ public static boolean isScanResultForOweTransitionNetwork(ScanResult scanResult) {
+ return scanResult.capabilities.contains("OWE_TRANSITION");
+ }
+
+ /**
* Helper method to check if the provided |scanResult| corresponds to SAE network.
* This checks if the provided capabilities string contains SAE or not.
*/
@@ -96,7 +104,7 @@ 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.
+ * network. This checks if the provided capabilities string contains PSK+SAE or not.
*/
public static boolean isScanResultForPskSaeTransitionNetwork(ScanResult scanResult) {
return scanResult.capabilities.contains("PSK+SAE");