From f294fbb8b6271d54a73bfe627503c92cc8974a85 Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Tue, 26 Nov 2019 07:44:35 -0800 Subject: WifiConfigStoreEncryptionUtil: Use 256 bit secret key Bug: 140485110 Test: Manual verification - Store a PSK network config on older build - Upgrade to build with this CL - adb shell settings put global niap_mode 1 - Ensured that the psk was read correctly on upgrade - Ensured that the psk was encrypted when stored on disk after upgrade Change-Id: I3b98c2c83b8aa6280c793068e5c275543ba69e8b --- .../com/android/server/wifi/util/WifiConfigStoreEncryptionUtil.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/service/java/com/android/server/wifi/util/WifiConfigStoreEncryptionUtil.java b/service/java/com/android/server/wifi/util/WifiConfigStoreEncryptionUtil.java index 2f9b08f2b..46bf0fee1 100644 --- a/service/java/com/android/server/wifi/util/WifiConfigStoreEncryptionUtil.java +++ b/service/java/com/android/server/wifi/util/WifiConfigStoreEncryptionUtil.java @@ -51,6 +51,7 @@ public class WifiConfigStoreEncryptionUtil { private static final String ALIAS_SUFFIX = ".data-encryption-key"; private static final String CIPHER_ALGORITHM = "AES/GCM/NoPadding"; private static final int GCM_TAG_LENGTH = 128; + private static final int KEY_LENGTH = 256; private static final String KEY_STORE = "AndroidKeyStore"; private final String mDataFileName; @@ -160,6 +161,7 @@ public class WifiConfigStoreEncryptionUtil { KeyProperties.PURPOSE_ENCRYPT | KeyProperties.PURPOSE_DECRYPT) .setBlockModes(KeyProperties.BLOCK_MODE_GCM) .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_NONE) + .setKeySize(KEY_LENGTH) .setUid(Process.WIFI_UID) .build(); -- cgit v1.2.3