From 806fd81a8249cdcc390e3068b07e8492ffa86cfa Mon Sep 17 00:00:00 2001 From: Hai Shalom Date: Tue, 13 Oct 2020 16:55:14 -0700 Subject: [PATCH] Make app installed cert flags persistent Store AppInstalledRootCaCert and AppInstalledPrivateKey flags in the config store to make them persistent. Resolves the issue of certs that remain on the device after a connection is removed. The reasone was that these flags were not persistent which caused the logic to treat the certs as installed by the user. Bug: 168871784 Test: Manually verify xml file contents Test: atest XmlUtilTest Change-Id: I06e93fa8688d1b483b68983d10b53fbe5acae32b --- .../net/wifi/WifiEnterpriseConfig.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java index 90edc4523b7b8..e127ea99c716b 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -1334,6 +1334,16 @@ public class WifiEnterpriseConfig implements Parcelable { return mIsAppInstalledDeviceKeyAndCert; } + /** + * Initialize the value of the app installed device key and cert flag. + * + * @param isAppInstalledDeviceKeyAndCert true or false + * @hide + */ + public void initIsAppInstalledDeviceKeyAndCert(boolean isAppInstalledDeviceKeyAndCert) { + mIsAppInstalledDeviceKeyAndCert = isAppInstalledDeviceKeyAndCert; + } + /** * Check if CA certificate was installed by an app, or manually (not by an app). If true, * CA certificate will be removed from key storage when this network is removed. If not, @@ -1347,6 +1357,16 @@ public class WifiEnterpriseConfig implements Parcelable { return mIsAppInstalledCaCert; } + /** + * Initialize the value of the app installed root CA cert flag. + * + * @param isAppInstalledCaCert true or false + * @hide + */ + public void initIsAppInstalledCaCert(boolean isAppInstalledCaCert) { + mIsAppInstalledCaCert = isAppInstalledCaCert; + } + /** * Set the OCSP type. * @param ocsp is one of {@link ##OCSP_NONE}, {@link #OCSP_REQUEST_CERT_STATUS},