Merge "Keystore 2.0 SPI: Fix engineDoFinal with null input." am: 06df6d84eb

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1680128

Change-Id: Ia75168fc7489fe24178b7b81db643bc43823d7de
This commit is contained in:
Treehugger Robot
2021-04-23 18:06:46 +00:00
committed by Automerger Merge Worker

View File

@@ -579,7 +579,11 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
protected final byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
throws IllegalBlockSizeException, BadPaddingException {
if (mCipher != null) {
return mCipher.doFinal(input, inputOffset, inputLen);
if (input == null && inputLen == 0) {
return mCipher.doFinal();
} else {
return mCipher.doFinal(input, inputOffset, inputLen);
}
}
if (mCachedException != null) {