Merge "Keystore 2.0 SPI: Fix engineDoFinal with null input."
This commit is contained in:
@@ -579,8 +579,12 @@ abstract class AndroidKeyStoreCipherSpiBase extends CipherSpi implements KeyStor
|
|||||||
protected final byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
|
protected final byte[] engineDoFinal(byte[] input, int inputOffset, int inputLen)
|
||||||
throws IllegalBlockSizeException, BadPaddingException {
|
throws IllegalBlockSizeException, BadPaddingException {
|
||||||
if (mCipher != null) {
|
if (mCipher != null) {
|
||||||
|
if (input == null && inputLen == 0) {
|
||||||
|
return mCipher.doFinal();
|
||||||
|
} else {
|
||||||
return mCipher.doFinal(input, inputOffset, inputLen);
|
return mCipher.doFinal(input, inputOffset, inputLen);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mCachedException != null) {
|
if (mCachedException != null) {
|
||||||
throw (IllegalBlockSizeException)
|
throw (IllegalBlockSizeException)
|
||||||
|
|||||||
Reference in New Issue
Block a user