summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorHai Shalom <haishalom@google.com>2019-05-10 15:21:58 -0700
committerHai Shalom <haishalom@google.com>2019-05-12 17:40:26 +0000
commitb70a500802ff55d13c71f7431e0c32d0220e9d04 (patch)
treec6d91bcae5e7838013c8fd86337f74d40461ac36 /tests
parentfcafe95467db28e1fd687abe71b396e313ce14ce (diff)
[OWE] Fix Open-OWE transition connectivity for non-supporting devices
Device running Q without OWE support could not connect to Open-OWE transition network. In InformationElementUti.java We check if OWE is supported because we are adding the OWE capabilities to the Open BSS. Non-supporting devices need to see this open network and ignore this element. Supporting devices need to parse the OWE IE, hide the Open BSS of OWE in transition, mode and connect to the Hidden one. Bug: 132455533 Test: Connect to OWE transition network with non-supporting device Test: Connect to OWE transition network with supporting device Test: Connect to OWE network with supporting device Test: Verify correct scan results on both devices Change-Id: I2d0d9f68abb36126aae0f011f6bc15a480bcff07
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java84
1 files changed, 69 insertions, 15 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
index cbb728644..46830f3f5 100644
--- a/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/util/InformationElementUtilTest.java
@@ -265,7 +265,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN-PSK-CCMP+TKIP]", result);
@@ -291,7 +291,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN]", result);
@@ -319,7 +319,7 @@ public class InformationElementUtilTest {
beaconCap.set(4);
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[WPA-PSK-CCMP+TKIP]", result);
@@ -343,7 +343,7 @@ public class InformationElementUtilTest {
beaconCap.set(4);
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[WPA]", result);
@@ -381,7 +381,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[WPA-PSK-CCMP+TKIP][RSN-PSK-CCMP+TKIP]", result);
@@ -420,7 +420,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, true);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN-PSK+SAE-CCMP]", result);
@@ -459,7 +459,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, true);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN-SAE+FT/SAE-CCMP]", result);
@@ -496,13 +496,67 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, true);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN-OWE-CCMP]", result);
}
/**
+ * Test Capabilities.generateCapabilitiesString() with OWE IE.
+ * Expect the function to return a string with the proper security information.
+ */
+ @Test
+ public void buildCapabilities_oweVsElementOweSupported() {
+ InformationElement ieOwe = new InformationElement();
+ ieOwe.id = InformationElement.EID_VSA;
+ ieOwe.bytes = new byte[] {
+ // OWE vendor specific
+ (byte) 0x50, (byte) 0x6F, (byte) 0x9A, (byte) 0x1C,
+ // OWE IE contains BSSID, SSID and channel of other BSS, but we don't parse it.
+ (byte) 0x00, (byte) 0x000, (byte) 0x00, (byte) 0x00 };
+
+ InformationElement[] ies = new InformationElement[] { ieOwe };
+
+ BitSet beaconCap = new BitSet(16);
+ beaconCap.set(0);
+
+ InformationElementUtil.Capabilities capabilities =
+ new InformationElementUtil.Capabilities();
+ capabilities.from(ies, beaconCap, true);
+ String result = capabilities.generateCapabilitiesString();
+
+ assertEquals("[RSN-OWE-CCMP][ESS]", result);
+ }
+
+ /**
+ * Test Capabilities.generateCapabilitiesString() with OWE IE.
+ * Expect the function to return a string with the proper security information.
+ */
+ @Test
+ public void buildCapabilities_oweVsElementOweNotSupported() {
+ InformationElement ieOwe = new InformationElement();
+ ieOwe.id = InformationElement.EID_VSA;
+ ieOwe.bytes = new byte[] {
+ // OWE vendor specific
+ (byte) 0x50, (byte) 0x6F, (byte) 0x9A, (byte) 0x1C,
+ // OWE IE contains BSSID, SSID and channel of other BSS, but we don't parse it.
+ (byte) 0x00, (byte) 0x000, (byte) 0x00, (byte) 0x00 };
+
+ InformationElement[] ies = new InformationElement[] { ieOwe };
+
+ BitSet beaconCap = new BitSet(16);
+ beaconCap.set(0);
+
+ InformationElementUtil.Capabilities capabilities =
+ new InformationElementUtil.Capabilities();
+ capabilities.from(ies, beaconCap, false);
+ String result = capabilities.generateCapabilitiesString();
+
+ assertEquals("[ESS]", result);
+ }
+
+ /**
* Test Capabilities.generateCapabilitiesString() with RSN IE, GCMP-256 and SUITE_B_192.
* Expect the function to return a string with the proper security information.
*/
@@ -533,7 +587,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[RSN-EAP_SUITE_B_192-GCMP-256]", result);
@@ -565,7 +619,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[WPA][RSN]", result);
@@ -599,7 +653,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
assertEquals("[WPA-PSK-CCMP+TKIP][WPS]", result);
@@ -627,7 +681,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
@@ -656,7 +710,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
@@ -684,7 +738,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();
@@ -713,7 +767,7 @@ public class InformationElementUtilTest {
InformationElementUtil.Capabilities capabilities =
new InformationElementUtil.Capabilities();
- capabilities.from(ies, beaconCap);
+ capabilities.from(ies, beaconCap, false);
String result = capabilities.generateCapabilitiesString();