From 1b291c13f4afa35b5452316280942e0de36e8562 Mon Sep 17 00:00:00 2001 From: Kenny Root Date: Wed, 20 Jan 2016 15:50:55 -0800 Subject: [PATCH] Stop using AlgNameMapper AlgNameMapper currently doesn't work after the transition to it being in Conscrypt, so just get rid of it altogether. Change-Id: I0e8b057915edcb584bd4470c43f3458efa49329e --- Android.mk | 2 +- src/com/android/settings/CredentialStorage.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Android.mk b/Android.mk index 7043ad4b11d..500a5723c36 100644 --- a/Android.mk +++ b/Android.mk @@ -1,7 +1,7 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) -LOCAL_JAVA_LIBRARIES := bouncycastle conscrypt telephony-common ims-common +LOCAL_JAVA_LIBRARIES := bouncycastle core-oj telephony-common ims-common LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 android-support-v13 jsr305 LOCAL_MODULE_TAGS := optional diff --git a/src/com/android/settings/CredentialStorage.java b/src/com/android/settings/CredentialStorage.java index 18b4ac8f40a..cc25db57f7d 100644 --- a/src/com/android/settings/CredentialStorage.java +++ b/src/com/android/settings/CredentialStorage.java @@ -48,7 +48,8 @@ import com.android.internal.widget.LockPatternUtils; import com.android.org.bouncycastle.asn1.ASN1InputStream; import com.android.org.bouncycastle.asn1.pkcs.PrivateKeyInfo; -import org.apache.harmony.security.utils.AlgNameMapper; +import sun.security.util.ObjectIdentifier; +import sun.security.x509.AlgorithmId; import java.io.ByteArrayInputStream; import java.io.IOException; @@ -217,8 +218,8 @@ public final class CredentialStorage extends Activity { try { ASN1InputStream bIn = new ASN1InputStream(new ByteArrayInputStream(keyData)); PrivateKeyInfo pki = PrivateKeyInfo.getInstance(bIn.readObject()); - String algId = pki.getAlgorithmId().getAlgorithm().getId(); - String algName = AlgNameMapper.map2AlgName(algId); + String algOid = pki.getAlgorithmId().getAlgorithm().getId(); + String algName = new AlgorithmId(new ObjectIdentifier(algOid)).getName(); return KeyChain.isBoundKeyAlgorithm(algName); } catch (IOException e) {