summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com/android/server/wifi/hotspot2
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-10-22 13:42:45 -0700
committerRoshan Pius <rpius@google.com>2019-11-14 11:18:00 -0800
commita161d62d9baac95a087cb3252d51c1fd101d24fa (patch)
tree4213efe8d35f12e1bd993bc35931b322a4da8f74 /tests/wifitests/src/com/android/server/wifi/hotspot2
parentbc8fa0c163c40afa999ac71cc78687bb845131ab (diff)
downloadandroid_frameworks_opt_net_wifi-a161d62d9baac95a087cb3252d51c1fd101d24fa.tar.gz
android_frameworks_opt_net_wifi-a161d62d9baac95a087cb3252d51c1fd101d24fa.tar.bz2
android_frameworks_opt_net_wifi-a161d62d9baac95a087cb3252d51c1fd101d24fa.zip
WifiConfigStore: Encrypt credentials for networks (1/4)
Changes in the CL: a) Introduced a new config store version. The new version gets rid of the integrity computation & adds support for encryption of credential data. b) Changed DataIntegrityChecker to WifiConfigStoreEncryptionUtil to help the different config store modules to encrypt/decrypt their credential data to be stored. c) Pass the version & the new EncryptionUtil to all the config store modules. The version is needed for the modules to handle upgrades. d) Use the WIFI_UID to store encryption key in keystore (to help ease migrate keys if we move to a separate process in R) Actual encryption of credential data/handling of upgrades will be added in the next CL. Bug: 140485110 Test: atest com.android.server.wifi Change-Id: I522b11ef2ffbdbf0ff19ae4f2643023df3843e5e Merged-In: I522b11ef2ffbdbf0ff19ae4f2643023df3843e5e
Diffstat (limited to 'tests/wifitests/src/com/android/server/wifi/hotspot2')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java7
-rw-r--r--tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java7
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java
index c76e2c878..7a815001c 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigSharedStoreDataTest.java
@@ -25,6 +25,7 @@ import androidx.test.filters.SmallTest;
import com.android.internal.util.FastXmlSerializer;
import com.android.server.wifi.WifiConfigStore;
+import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil;
import org.junit.Before;
import org.junit.Test;
@@ -62,7 +63,7 @@ public class PasspointConfigSharedStoreDataTest {
final XmlSerializer out = new FastXmlSerializer();
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
out.setOutput(outputStream, StandardCharsets.UTF_8.name());
- mConfigStoreData.serializeData(out);
+ mConfigStoreData.serializeData(out, mock(WifiConfigStoreEncryptionUtil.class));
out.flush();
return outputStream.toByteArray();
}
@@ -77,7 +78,9 @@ public class PasspointConfigSharedStoreDataTest {
final XmlPullParser in = Xml.newPullParser();
final ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
in.setInput(inputStream, StandardCharsets.UTF_8.name());
- mConfigStoreData.deserializeData(in, in.getDepth());
+ mConfigStoreData.deserializeData(in, in.getDepth(),
+ WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION,
+ mock(WifiConfigStoreEncryptionUtil.class));
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java
index 82cdb5a90..5278e1933 100644
--- a/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/hotspot2/PasspointConfigUserStoreDataTest.java
@@ -32,6 +32,7 @@ import com.android.internal.util.FastXmlSerializer;
import com.android.server.wifi.SIMAccessor;
import com.android.server.wifi.WifiConfigStore;
import com.android.server.wifi.WifiKeyStore;
+import com.android.server.wifi.util.WifiConfigStoreEncryptionUtil;
import org.junit.Before;
import org.junit.Test;
@@ -213,7 +214,7 @@ public class PasspointConfigUserStoreDataTest {
final XmlSerializer out = new FastXmlSerializer();
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
out.setOutput(outputStream, StandardCharsets.UTF_8.name());
- mConfigStoreData.serializeData(out);
+ mConfigStoreData.serializeData(out, mock(WifiConfigStoreEncryptionUtil.class));
out.flush();
return outputStream.toByteArray();
}
@@ -228,7 +229,9 @@ public class PasspointConfigUserStoreDataTest {
final XmlPullParser in = Xml.newPullParser();
final ByteArrayInputStream inputStream = new ByteArrayInputStream(data);
in.setInput(inputStream, StandardCharsets.UTF_8.name());
- mConfigStoreData.deserializeData(in, in.getDepth());
+ mConfigStoreData.deserializeData(in, in.getDepth(),
+ WifiConfigStore.ENCRYPT_CREDENTIALS_CONFIG_STORE_DATA_VERSION,
+ mock(WifiConfigStoreEncryptionUtil.class));
}
/**