Keystore 2.0: No longer install the legacy provider.

The legacy provider is obsolete now that all calling code has
been fixed.

Bug: 183100147
Bug: 183093711
Bug: 171305684
Test: N/A
Change-Id: I0d71d3c9cdd586a508827eb26120c872cb8643ea
This commit is contained in:
Janis Danisevskis
2021-03-18 08:52:58 -07:00
parent aca2594a79
commit d2d4c69a66

View File

@@ -145,23 +145,15 @@ public class AndroidKeyStoreProvider extends Provider {
sInstalled = true;
Security.addProvider(new AndroidKeyStoreProvider());
Security.addProvider(
new android.security.keystore.AndroidKeyStoreProvider(
"AndroidKeyStoreLegacy"));
Provider workaroundProvider = new AndroidKeyStoreBCWorkaroundProvider();
Provider legacyWorkaroundProvider =
new android.security.keystore.AndroidKeyStoreBCWorkaroundProvider(
"AndroidKeyStoreBCWorkaroundLegacy");
if (bcProviderIndex != -1) {
// Bouncy Castle provider found -- install the workaround provider above it.
// insertProviderAt uses 1-based positions.
Security.insertProviderAt(legacyWorkaroundProvider, bcProviderIndex + 1);
Security.insertProviderAt(workaroundProvider, bcProviderIndex + 1);
} else {
// Bouncy Castle provider not found -- install the workaround provider at lowest
// priority.
Security.addProvider(workaroundProvider);
Security.addProvider(legacyWorkaroundProvider);
}
}