java-17-openjdk-portable/jdk8312489-max_sig_default_increase.patch
Jiri 289d0e958f updated to OpenJDK 17.0.9 (2023-10-17)
- adjsuted generate_source_tarball
- removed icedtea_sync
- dropped standalone licenses
- added usntripped subpkg
- added docs subpkg
- adjsuted versions of bundled libraries
- build refactored to several solid methods following gnu_andrew
- removed no longer needed jdk8305995-footprint_regression_from_jdk_8224957, nss.fips.cfg.in, rh1648644-java_access_bridge_privileged_security.patch
- added jdk8312489-max_sig_default_increase.patch
- aligned fips-17u-51e1d00be4e.patch (gnu_andrew)
- fixed '--without release' build-ability by moving docs and misc to
  if-release only
2023-11-23 16:12:39 +01:00

51 lines
2.7 KiB
Diff

commit 5b613e3ebed6c141146e743e64c894fe4f39421e
Author: Andrew John Hughes <andrew@openjdk.org>
Date: Fri Sep 1 15:53:41 2023 +0000
8312489: Increase jdk.jar.maxSignatureFileSize default which is too low for JARs such as WhiteSource/Mend unified agent jar
Backport-of: e47a84f23dd2608c6f5748093eefe301fb5bf750
diff --git a/src/java.base/share/classes/java/util/jar/JarFile.java b/src/java.base/share/classes/java/util/jar/JarFile.java
index bd538649a4f..70cf99504e4 100644
--- a/src/java.base/share/classes/java/util/jar/JarFile.java
+++ b/src/java.base/share/classes/java/util/jar/JarFile.java
@@ -803,7 +803,9 @@ private byte[] getBytes(ZipEntry ze) throws IOException {
throw new IOException("Unsupported size: " + uncompressedSize +
" for JarEntry " + ze.getName() +
". Allowed max size: " +
- SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes");
+ SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " +
+ "You can use the jdk.jar.maxSignatureFileSize " +
+ "system property to increase the default value.");
}
int len = (int)uncompressedSize;
int bytesRead;
diff --git a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
index 4ea9255ba0a..05acdcb9474 100644
--- a/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
+++ b/src/java.base/share/classes/sun/security/util/SignatureFileVerifier.java
@@ -856,16 +856,16 @@ private static int initializeMaxSigFileSize() {
* the maximum allowed number of bytes for the signature-related files
* in a JAR file.
*/
- Integer tmp = GetIntegerAction.privilegedGetProperty(
- "jdk.jar.maxSignatureFileSize", 8000000);
+ int tmp = GetIntegerAction.privilegedGetProperty(
+ "jdk.jar.maxSignatureFileSize", 16000000);
if (tmp < 0 || tmp > MAX_ARRAY_SIZE) {
if (debug != null) {
- debug.println("Default signature file size 8000000 bytes " +
- "is used as the specified size for the " +
- "jdk.jar.maxSignatureFileSize system property " +
+ debug.println("The default signature file size of 16000000 bytes " +
+ "will be used for the jdk.jar.maxSignatureFileSize " +
+ "system property since the specified value " +
"is out of range: " + tmp);
}
- tmp = 8000000;
+ tmp = 16000000;
}
return tmp;
}