summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2020-05-28 10:29:25 -0700
committerRoshan Pius <rpius@google.com>2020-05-28 18:46:41 +0000
commite8c065166a74a62ce5ed0533e997e3a63cab6ae9 (patch)
tree679bc7b47ef7eaa1b3f0feb2727112e9a24eeec7 /tests
parent819407400d52526b8f392e5842e3ddd3059558a9 (diff)
WifiBackupRestore: Parse auth_alg from supplicant backup data
This is the legacy Pre-O backup format. Add parsing support for auth algorithm field. Bug: 151702376 Test: atest com.android.server.wifi Change-Id: I271af411560808714222726c27bf1f8aa56bc30f
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java
index a2a1a4595..6b01f8e45 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiBackupRestoreTest.java
@@ -832,11 +832,13 @@ public class WifiBackupRestoreTest extends WifiBaseTest {
List<WifiConfiguration> configurations = new ArrayList<>();
WifiConfiguration wepNetwork = WifiConfigurationTestUtil.createWepNetwork();
+ wepNetwork.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.SHARED);
wepNetwork.setIpConfiguration(
WifiConfigurationTestUtil.createDHCPIpConfigurationWithPacProxy());
configurations.add(wepNetwork);
WifiConfiguration pskNetwork = WifiConfigurationTestUtil.createPskNetwork();
+ pskNetwork.allowedAuthAlgorithms.set(WifiConfiguration.AuthAlgorithm.OPEN);
pskNetwork.setIpConfiguration(
WifiConfigurationTestUtil.createStaticIpConfigurationWithPacProxy());
configurations.add(pskNetwork);
@@ -1113,10 +1115,10 @@ public class WifiBackupRestoreTest extends WifiBaseTest {
throws IOException {
out.write("network={\n");
out.write(" " + "ssid=" + configuration.SSID + "\n");
- String allowedKeyManagement = "";
if (configuration.hiddenSSID) {
out.write(" " + "scan_ssid=1" + "\n");
}
+ String allowedKeyManagement = "";
if (configuration.allowedKeyManagement.get(WifiConfiguration.KeyMgmt.NONE)) {
allowedKeyManagement += "NONE";
}
@@ -1130,6 +1132,14 @@ public class WifiBackupRestoreTest extends WifiBaseTest {
allowedKeyManagement += "IEEE8021X ";
}
out.write(" " + "key_mgmt=" + allowedKeyManagement + "\n");
+ String allowedAuthAlgorithm = "";
+ if (configuration.allowedAuthAlgorithms.get(WifiConfiguration.AuthAlgorithm.OPEN)) {
+ allowedAuthAlgorithm += "OPEN ";
+ }
+ if (configuration.allowedAuthAlgorithms.get(WifiConfiguration.AuthAlgorithm.SHARED)) {
+ allowedAuthAlgorithm += "SHARED ";
+ }
+ out.write(" " + "auth_alg=" + allowedAuthAlgorithm + "\n");
if (configuration.preSharedKey != null) {
out.write(" " + "psk=" + configuration.preSharedKey + "\n");
}