aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDominik Stadler <centic@apache.org>2023-12-30 11:11:21 +0000
committerDominik Stadler <centic@apache.org>2023-12-30 11:11:21 +0000
commita9ca01e3fdc0ea12b8457b253f3817208283585b (patch)
treed26e7ebe885b2859bbc582f110b129eb8922ed29
parentfb3f3ef26fe61145e75fb059721476927d6848c4 (diff)
downloadpoi-a9ca01e3fdc0ea12b8457b253f3817208283585b.tar.gz
poi-a9ca01e3fdc0ea12b8457b253f3817208283585b.zip
Don't fail on JDK 21.0.1 if one signature check fails
See https://bugs.openjdk.org/browse/JDK-8320597 for the related bug-report for the JDK itself git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1914986 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java
index 3a7e4eb5ed..e08c4bce06 100644
--- a/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java
+++ b/poi-ooxml/src/test/java/org/apache/poi/poifs/crypt/dsig/TestSignatureInfo.java
@@ -253,9 +253,15 @@ class TestSignatureInfo {
si.setSignatureConfig(sic);
boolean isValid = si.verifySignature();
+ // We reported https://bugs.openjdk.org/browse/JDK-8320597 because of this, it will be fixed in JDK 22
+ // and maybe in newer JDK 21 patch-levels
+ assumeTrue(isValid && !"21.0.1".equals(System.getProperty("java.version")),
+ "This fails on JDK 21.0.1, see https://bugs.openjdk.org/browse/JDK-8320597");
+
assertTrue(isValid,
// add some details to find out why "verifySignature()" returns false sometimes
- "Verifying signature failed, hasNext: " + si.getSignatureParts().iterator().hasNext() + ": " +
+ "Failed for " + System.getProperty("java.version") +
+ ": Verifying signature failed, hasNext: " + si.getSignatureParts().iterator().hasNext() + ": " +
(si.getSignatureParts().iterator().hasNext() ? si.getSignatureParts().iterator() : ""));
}
}