Merge "Keystore 2.0: Fix infinit recursion." am: 544f3d5211
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1645913 Change-Id: I647135ccc2f45b50e828dbd4e0f1f2cfea1cef00
This commit is contained in:
@@ -124,7 +124,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
|
||||
resetAll();
|
||||
|
||||
// Public key operations get diverted to the default provider.
|
||||
if (opmode == Cipher.ENCRYPT_MODE
|
||||
if (!(key instanceof AndroidKeyStorePrivateKey)
|
||||
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
|
||||
try {
|
||||
mCipher = Cipher.getInstance(getTransform());
|
||||
@@ -186,7 +186,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
|
||||
resetAll();
|
||||
|
||||
// Public key operations get diverted to the default provider.
|
||||
if (opmode == Cipher.ENCRYPT_MODE
|
||||
if (!(key instanceof AndroidKeyStorePrivateKey)
|
||||
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
|
||||
try {
|
||||
mCipher = Cipher.getInstance(getTransform());
|
||||
@@ -216,7 +216,7 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
|
||||
resetAll();
|
||||
|
||||
// Public key operations get diverted to the default provider.
|
||||
if (opmode == Cipher.ENCRYPT_MODE
|
||||
if (!(key instanceof AndroidKeyStorePrivateKey)
|
||||
&& (key instanceof PrivateKey || key instanceof PublicKey)) {
|
||||
try {
|
||||
mCipher = Cipher.getInstance(getTransform());
|
||||
|
||||
Reference in New Issue
Block a user