From e0f6a64678cffd6ebe3be8a2c797fca9cd82a029 Mon Sep 17 00:00:00 2001 From: Andreas Beeker Date: Mon, 13 Jul 2015 22:49:59 +0000 Subject: [PATCH] Bug 58133 - Agile encryption - wrong checksum calculation git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1690837 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java index f663c7e08..2c5716d2a 100644 --- a/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java +++ b/src/java/org/apache/poi/poifs/crypt/ChunkedCipherOutputStream.java @@ -134,7 +134,7 @@ public abstract class ChunkedCipherOutputStream extends FilterOutputStream { super.close(); int oleStreamSize = (int)(fileOut.length()+LittleEndianConsts.LONG_SIZE); - calculateChecksum(fileOut, oleStreamSize); + calculateChecksum(fileOut, (int)_pos); dir.createDocument(DEFAULT_POIFS_ENTRY, oleStreamSize, new EncryptedPackageWriter()); createEncryptionInfoEntry(dir, fileOut); } catch (GeneralSecurityException e) {