diff options
author | Daulet Zhanguzin <dauletz@google.com> | 2020-05-01 22:33:16 +0100 |
---|---|---|
committer | Daulet Zhanguzin <dauletz@google.com> | 2020-05-04 14:11:57 +0100 |
commit | 6bfb3fc9615696ab0cfc6ab0b479454d804a0bda (patch) | |
tree | 651f5ab0e8f0c04b64926f5355976ea5c5ea3b25 /bcprov/src/main/java/org/bouncycastle/jcajce | |
parent | 105445433dfb81761347d614d691721a4fe1c5d0 (diff) | |
download | bouncycastle-6bfb3fc9615696ab0cfc6ab0b479454d804a0bda.tar.gz |
Load default KeyFactory instead of BC's implementation
BouncyCastle has a shortcut for getting its own KeyFactory implementations. Since some of them are removed, e.g. KeyFactory.RSA, we need to load other available implementations.In particular BKS KeyStore, that is only available in BouncyCastle, uses KeyFactory.RSA, so this Android modifications are necessary for the KeyStore to keep functioning.
Test: cts -m CtsLibcoreOkHttpTestCases
Bug: 67761667
Change-Id: I98adb4d2f475e8b600a44b655ade83cd94c1efbd
Diffstat (limited to 'bcprov/src/main/java/org/bouncycastle/jcajce')
-rw-r--r-- | bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/DESede.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/DESede.java b/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/DESede.java index 24785a43..d5a538d9 100644 --- a/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/DESede.java +++ b/bcprov/src/main/java/org/bouncycastle/jcajce/provider/symmetric/DESede.java @@ -403,7 +403,8 @@ public final class DESede // provider.addAlgorithm("Alg.Alias.AlgorithmParameterGenerator.TDEA", "DESEDE"); provider.addAlgorithm("Alg.Alias.SecretKeyFactory.TDEA", "DESEDE"); - if (provider.hasAlgorithm("MessageDigest", "SHA-1")) + // Android-removed Bouncy Castle's SHA-1 implementation is removed but we still need PBEWithSHAAnd3-KeyTripleDES-CBC + // if (provider.hasAlgorithm("MessageDigest", "SHA-1")) { provider.addAlgorithm("Cipher.PBEWITHSHAAND3-KEYTRIPLEDES-CBC", PREFIX + "$PBEWithSHAAndDES3Key"); // BEGIN Android-removed: Unsupported algorithms |