aboutsummaryrefslogtreecommitdiffstats
path: root/poi/src
diff options
context:
space:
mode:
Diffstat (limited to 'poi/src')
-rw-r--r--poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
index e65e679b35..add680a728 100644
--- a/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
+++ b/poi/src/main/java/org/apache/poi/poifs/crypt/agile/AgileEncryptionVerifier.java
@@ -51,10 +51,16 @@ public class AgileEncryptionVerifier extends EncryptionVerifier {
setCipherAlgorithm(keyData.getCipherAlgorithm());
setKeySize(keyData.getKeyBits());
- int blockSize = keyData.getBlockSize();
+ Integer blockSize = keyData.getBlockSize();
+ if (blockSize == null) {
+ throw new IllegalArgumentException("blockSize not set");
+ }
setBlockSize(blockSize);
- int hashSize = keyData.getHashSize();
+ Integer hashSize = keyData.getHashSize();
+ if (hashSize == null) {
+ throw new IllegalArgumentException("hashSize not set");
+ }
HashAlgorithm ha = keyData.getHashAlgorithm();
setHashAlgorithm(ha);