Fixing the IV for certain reads

This commit is contained in:
Maschell 2019-04-07 00:12:20 +02:00
parent 0261e33b80
commit a5bc706cb9

View File

@ -116,7 +116,7 @@ public class NUSDecryption extends AESDecryption {
// current IV. // current IV.
if (skipoffset > 0) { if (skipoffset > 0) {
int skippedBytes = StreamUtils.getChunkFromStream(inputStream, blockBuffer, overflow, skipoffset); int skippedBytes = StreamUtils.getChunkFromStream(inputStream, blockBuffer, overflow, skipoffset);
if (skippedBytes > 16) { if (skippedBytes >= 16) {
IV = Arrays.copyOfRange(blockBuffer, skippedBytes - 16, skippedBytes); IV = Arrays.copyOfRange(blockBuffer, skippedBytes - 16, skippedBytes);
} }
skipoffset = 0; skipoffset = 0;