diff options
author | Kenny Root <kroot@google.com> | 2013-04-12 17:36:25 -0700 |
---|---|---|
committer | Kenny Root <kroot@google.com> | 2013-04-12 18:09:04 -0700 |
commit | b2c0ff64d8ff92dab53e969a44fa12427d145952 (patch) | |
tree | 3b3139b4fd331e0ce65d245510d54c15ae3a03ae /wifi | |
parent | 8692685a54f6bf87dadc82fbd5576cdb81ba662b (diff) | |
download | frameworks_base-b2c0ff64d8ff92dab53e969a44fa12427d145952.zip frameworks_base-b2c0ff64d8ff92dab53e969a44fa12427d145952.tar.gz frameworks_base-b2c0ff64d8ff92dab53e969a44fa12427d145952.tar.bz2 |
Remove old KeyStore call sites
Remove the call sites that don't have the flags specified. This is to
ensure that callers know what flags they're setting.
Bug: 8122243
Change-Id: Ifbd178fddbf8dbd8f7b821ea739a20d056ef9fa7
Diffstat (limited to 'wifi')
-rw-r--r-- | wifi/java/android/net/wifi/WifiEnterpriseConfig.java | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java index f73a13c..4e7497c 100644 --- a/wifi/java/android/net/wifi/WifiEnterpriseConfig.java +++ b/wifi/java/android/net/wifi/WifiEnterpriseConfig.java @@ -19,17 +19,12 @@ import android.os.Parcel; import android.os.Parcelable; import android.os.Process; import android.security.Credentials; +import android.security.KeyStore; import android.text.TextUtils; -import com.android.org.bouncycastle.asn1.ASN1InputStream; -import com.android.org.bouncycastle.asn1.ASN1Sequence; -import com.android.org.bouncycastle.asn1.DEROctetString; -import com.android.org.bouncycastle.asn1.x509.BasicConstraints; - import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.KeyFactory; -import java.security.KeyStore; import java.security.NoSuchAlgorithmException; import java.security.PrivateKey; import java.security.cert.Certificate; @@ -481,7 +476,8 @@ public class WifiEnterpriseConfig implements Parcelable { String caCertName = Credentials.CA_CERTIFICATE + name; if (mClientCertificate != null) { byte[] privKeyData = mClientPrivateKey.getEncoded(); - ret = keyStore.importKey(privKeyName, privKeyData, Process.WIFI_UID); + ret = keyStore.importKey(privKeyName, privKeyData, Process.WIFI_UID, + KeyStore.FLAG_ENCRYPTED); if (ret == false) { return ret; } @@ -525,7 +521,7 @@ public class WifiEnterpriseConfig implements Parcelable { Certificate cert) { try { byte[] certData = Credentials.convertToPem(cert); - return keyStore.put(name, certData, Process.WIFI_UID); + return keyStore.put(name, certData, Process.WIFI_UID, KeyStore.FLAG_ENCRYPTED); } catch (IOException e1) { return false; } catch (CertificateException e2) { @@ -533,7 +529,7 @@ public class WifiEnterpriseConfig implements Parcelable { } } - void removeKeys(android.security.KeyStore keyStore) { + void removeKeys(KeyStore keyStore) { String client = getFieldValue(CLIENT_CERT_KEY, CLIENT_CERT_PREFIX); // a valid client certificate is configured if (!TextUtils.isEmpty(client)) { |