Blame SOURCES/jdk8312489-max_sig_default_increase.patch

6a4ec9
commit c38a36f124a7eb28920cc367cb01b67d973a55c0
6a4ec9
Author: Andrew John Hughes <andrew@openjdk.org>
6a4ec9
Date:   Wed Oct 11 01:42:03 2023 +0100
6a4ec9
6a4ec9
    Backport e47a84f23dd2608c6f5748093eefe301fb5bf750
6a4ec9
6a4ec9
diff --git a/jdk/src/share/classes/java/util/jar/JarFile.java b/jdk/src/share/classes/java/util/jar/JarFile.java
6a4ec9
index a26dcc4a1c7..ac2e1c9d6a8 100644
6a4ec9
--- a/jdk/src/share/classes/java/util/jar/JarFile.java
6a4ec9
+++ b/jdk/src/share/classes/java/util/jar/JarFile.java
6a4ec9
@@ -436,7 +436,9 @@ class JarFile extends ZipFile {
6a4ec9
                 throw new IOException("Unsupported size: " + uncompressedSize +
6a4ec9
                         " for JarEntry " + ze.getName() +
6a4ec9
                         ". Allowed max size: " +
6a4ec9
-                        SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes");
6a4ec9
+                        SignatureFileVerifier.MAX_SIG_FILE_SIZE + " bytes. " +
6a4ec9
+                        "You can use the jdk.jar.maxSignatureFileSize " +
6a4ec9
+                        "system property to increase the default value.");
6a4ec9
             }
6a4ec9
             int len = (int)uncompressedSize;
6a4ec9
             byte[] b = IOUtils.readAllBytes(is);
6a4ec9
diff --git a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java
6a4ec9
index c335e964f63..afdfa406b92 100644
6a4ec9
--- a/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java
6a4ec9
+++ b/jdk/src/share/classes/sun/security/util/SignatureFileVerifier.java
6a4ec9
@@ -855,16 +855,16 @@ public class SignatureFileVerifier {
6a4ec9
          * the maximum allowed number of bytes for the signature-related files
6a4ec9
          * in a JAR file.
6a4ec9
          */
6a4ec9
-        Integer tmp = AccessController.doPrivileged(new GetIntegerAction(
6a4ec9
-                "jdk.jar.maxSignatureFileSize", 8000000));
6a4ec9
+        int tmp = AccessController.doPrivileged(new GetIntegerAction(
6a4ec9
+                "jdk.jar.maxSignatureFileSize", 16000000));
6a4ec9
         if (tmp < 0 || tmp > MAX_ARRAY_SIZE) {
6a4ec9
             if (debug != null) {
6a4ec9
-                debug.println("Default signature file size 8000000 bytes " +
6a4ec9
-                        "is used as the specified size for the " +
6a4ec9
-                        "jdk.jar.maxSignatureFileSize system property " +
6a4ec9
+                debug.println("The default signature file size of 16000000 bytes " +
6a4ec9
+                        "will be used for the jdk.jar.maxSignatureFileSize " +
6a4ec9
+                        "system property since the specified value " +
6a4ec9
                         "is out of range: " + tmp);
6a4ec9
             }
6a4ec9
-            tmp = 8000000;
6a4ec9
+            tmp = 16000000;
6a4ec9
         }
6a4ec9
         return tmp;
6a4ec9
     }