diff options
author | Andreas Beeker <kiwiwings@apache.org> | 2016-08-08 00:10:44 +0000 |
---|---|---|
committer | Andreas Beeker <kiwiwings@apache.org> | 2016-08-08 00:10:44 +0000 |
commit | 075e2bfce2f6c881820c7ec2d069d5331a2b6c9b (patch) | |
tree | b1b775c4bd5c3930de0de69670a36fc5e88247b0 /src/scratchpad | |
parent | e84c6152dde07a48b2982f9e9ce016529548e11d (diff) | |
download | poi-075e2bfce2f6c881820c7ec2d069d5331a2b6c9b.tar.gz poi-075e2bfce2f6c881820c7ec2d069d5331a2b6c9b.zip |
HSSF CryptoAPI decryption support
git-svn-id: https://svn.apache.org/repos/asf/poi/branches/hssf_cryptoapi@1755461 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/scratchpad')
-rw-r--r-- | src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java b/src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java index c21f89dd13..57f0f31ed7 100644 --- a/src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java +++ b/src/scratchpad/src/org/apache/poi/hslf/record/DocumentEncryptionAtom.java @@ -53,7 +53,8 @@ public final class DocumentEncryptionAtom extends PositionDependentRecordAtom { ByteArrayInputStream bis = new ByteArrayInputStream(source, start+8, len-8); LittleEndianInputStream leis = new LittleEndianInputStream(bis); - ei = new EncryptionInfo(leis, true); + ei = new EncryptionInfo(leis, EncryptionMode.cryptoAPI); + leis.close(); } public DocumentEncryptionAtom() { @@ -121,6 +122,7 @@ public final class DocumentEncryptionAtom extends PositionDependentRecordAtom { LittleEndian.putInt(_header, 4, bos.getWriteIndex()); out.write(_header); out.write(data, 0, bos.getWriteIndex()); + bos.close(); } @Override |