diff options
Diffstat (limited to 'poi/src')
-rw-r--r-- | poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java index 3d08cf7fbf..fc2828ed0d 100644 --- a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java +++ b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionHeader.java @@ -79,10 +79,14 @@ public class AgileEncryptionHeader extends EncryptionHeader { keyData.getHashAlgorithm() + " @ " + hashSize + " bytes"); } + if (keyData.getSaltSize() == null) { + throw new EncryptedDocumentException("Invalid salt length: " + keyData.getSaltSize()); + } + int saltLength = keyData.getSaltSize(); setKeySalt(keyData.getSaltValue()); if (getKeySalt().length != saltLength) { - throw new EncryptedDocumentException("Invalid salt length"); + throw new EncryptedDocumentException("Invalid salt length: " + getKeySalt().length + " and " + saltLength); } DataIntegrity di = ed.getDataIntegrity(); |