Skip to content

Commit b372b4b

Browse files
committed
8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar
Reviewed-by: sgehwolf Backport-of: e47a84f23dd2608c6f5748093eefe301fb5bf750
1 parent 10a653e commit b372b4b

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

jdk/src/share/classes/java/util/jar/JarFile.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,9 @@ private byte[] getBytes(ZipEntry ze) throws IOException {
436436
throw new IOException("Unsupported size: " + uncompressedSize +
437437
" for JarEntry " + ze.getName() +
438438
". Allowed max size: " +
439-
SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes");
439+
SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " +
440+
"You can use the jdk.jar.maxSignatureFileSize " +
441+
"system property to increase the default value.");
440442
}
441443
int len = (int)uncompressedSize;
442444
byte[] b = IOUtils.readAllBytes(is);

jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -855,16 +855,16 @@ private static int initializeMaxSigFileSize() {
855855
* the maximum allowed number of bytes for the signature-related files
856856
* in a JAR file.
857857
*/
858-
Integer tmp = AccessController.doPrivileged(new GetIntegerAction(
859-
"jdk.jar.maxSignatureFileSize", 8000000));
858+
int tmp = AccessController.doPrivileged(new GetIntegerAction(
859+
"jdk.jar.maxSignatureFileSize", 16000000));
860860
if (tmp < 0 || tmp > MAX_ARRAY_SIZE) {
861861
if (debug != null) {
862-
debug.println("Default signature file size 8000000 bytes " +
863-
"is used as the specified size for the " +
864-
"jdk.jar.maxSignatureFileSize system property " +
862+
debug.println("The default signature file size of 16000000 bytes " +
863+
"will be used for the jdk.jar.maxSignatureFileSize " +
864+
"system property since the specified value " +
865865
"is out of range: " + tmp);
866866
}
867-
tmp = 8000000;
867+
tmp = 16000000;
868868
}
869869
return tmp;
870870
}

0 commit comments

Comments
 (0)