Skip to content

Commit

Permalink
Don't fail on JDK 21.0.1 if one signature check fails
Browse files Browse the repository at this point in the history
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
  • Loading branch information
centic9 committed Dec 30, 2023
1 parent fb3f3ef commit a9ca01e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,15 @@ void office2007prettyPrintedRels() throws Exception {
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() : ""));
}
}
Expand Down

0 comments on commit a9ca01e

Please sign in to comment.