don't decrypt file size obfucscation padding

This commit is contained in:
Sebastian Stenzel
2015-07-25 16:18:02 +02:00
parent bc0a26b0ad
commit 9771c6d1e7

View File

@@ -426,7 +426,7 @@ public class Aes256Cryptor implements Cryptor, AesCryptographicConfiguration {
byte[] buffer = new byte[CONTENT_MAC_BLOCK + 32];
int n = 0;
long blockNum = 0;
while ((n = IOUtils.read(in, buffer)) > 0) {
while ((n = IOUtils.read(in, buffer)) > 0 && bytesDecrypted < fileSize) {
if (n < 32) {
throw new DecryptFailedException("Invalid file content, missing MAC.");
}