This is an automated email from the ASF dual-hosted git repository.
pjfanning pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/poi.git
The following commit(s) were added to refs/heads/trunk by this push:
new b51eeed176 Update AgileEncryptionVerifier.java
b51eeed176 is described below
commit b51eeed1761127372e7e133f69d4f5ed99678ebd
Author: PJ Fanning <[email protected]>
AuthorDate: Mon May 25 23:15:47 2026 +0100
Update AgileEncryptionVerifier.java
---
.../poi/poifs/crypt/agile/AgileEncryptionVerifier.java | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
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 1fc3efaee2..e63ac9f848 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
@@ -27,11 +27,13 @@ import org.apache.poi.poifs.crypt.HashAlgorithm;
*/
public class AgileEncryptionVerifier extends EncryptionVerifier {
+ private static final int DEFAULT_MAX_SPIN_COUNT = 1_000_000;
+
/**
* Maximum allowed spinCount to prevent CPU-exhaustion DoS via crafted
documents.
* Values beyond this are rejected during parsing.
*/
- private static final int MAX_SPIN_COUNT = 1_000_000;
+ private static int MAX_SPIN_COUNT = DEFAULT_MAX_SPIN_COUNT;
private int keyBits = -1;
private int blockSize = -1;
@@ -39,11 +41,21 @@ public class AgileEncryptionVerifier extends
EncryptionVerifier {
/**
* Maximum allowed spinCount to prevent CPU-exhaustion DoS via crafted
documents.
* Values beyond this are rejected during parsing.
+ * @since 6.0.0
*/
public static int getMaxSpinCount() {
return MAX_SPIN_COUNT;
}
+ /**
+ * Maximum allowed spinCount to prevent CPU-exhaustion DoS via crafted
documents.
+ * Values beyond this are rejected during parsing.
+ * @since 6.0.0
+ */
+ public static void setMaxSpinCount(final int maxSpinCount) {
+ MAX_SPIN_COUNT = maxSpinCount;
+ }
+
@SuppressWarnings("unused")
public AgileEncryptionVerifier(String descriptor) {
this(AgileEncryptionInfoBuilder.parseDescriptor(descriptor));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]