Merge "Keystore 2.0: Fix infinit recursion."

This commit is contained in:
Yo Chiang
2021-03-19 08:10:39 +00:00
committed by Gerrit Code Review

View File

@@ -124,7 +124,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
resetAll(); resetAll();
// Public key operations get diverted to the default provider. // Public key operations get diverted to the default provider.
if (opmode == Cipher.ENCRYPT_MODE if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) { && (key instanceof PrivateKey || key instanceof PublicKey)) {
try { try {
mCipher = Cipher.getInstance(getTransform()); mCipher = Cipher.getInstance(getTransform());
@@ -186,7 +186,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
resetAll(); resetAll();
// Public key operations get diverted to the default provider. // Public key operations get diverted to the default provider.
if (opmode == Cipher.ENCRYPT_MODE if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) { && (key instanceof PrivateKey || key instanceof PublicKey)) {
try { try {
mCipher = Cipher.getInstance(getTransform()); mCipher = Cipher.getInstance(getTransform());
@@ -216,7 +216,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
resetAll(); resetAll();
// Public key operations get diverted to the default provider. // Public key operations get diverted to the default provider.
if (opmode == Cipher.ENCRYPT_MODE if (!(key instanceof AndroidKeyStorePrivateKey)
&& (key instanceof PrivateKey || key instanceof PublicKey)) { && (key instanceof PrivateKey || key instanceof PublicKey)) {
try { try {
mCipher = Cipher.getInstance(getTransform()); mCipher = Cipher.getInstance(getTransform());