Skip to content

Commit

Permalink
8312489: Increase jdk.jar.maxSignatureFileSize default which is too l…
Browse files Browse the repository at this point in the history
…ow for JARs such as WhiteSource/Mend unified agent jar

Reviewed-by: mullan, mbaesken
  • Loading branch information
Hai-May Chao committed Jul 31, 2023
1 parent 78f6799 commit e47a84f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion src/java.base/share/classes/java/util/jar/JarFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -802,7 +802,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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,16 +847,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;
}
Expand Down

5 comments on commit e47a84f

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on e47a84f Aug 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew the backport was successfully created on the branch gnu-andrew-backport-e47a84f2 in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit e47a84f2 from the openjdk/jdk repository.

The commit being backported was authored by Hai-May Chao on 31 Jul 2023 and was reviewed by Sean Mullan and Matthias Baesken.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git gnu-andrew-backport-e47a84f2:gnu-andrew-backport-e47a84f2
$ git checkout gnu-andrew-backport-e47a84f2
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git gnu-andrew-backport-e47a84f2

@gnu-andrew
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/backport jdk11u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on e47a84f Sep 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gnu-andrew the backport was successfully created on the branch gnu-andrew-backport-e47a84f2 in my personal fork of openjdk/jdk11u-dev. To create a pull request with this backport targeting openjdk/jdk11u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit e47a84f2 from the openjdk/jdk repository.

The commit being backported was authored by Hai-May Chao on 31 Jul 2023 and was reviewed by Sean Mullan and Matthias Baesken.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk11u-dev:

$ git fetch https://github.com/openjdk-bots/jdk11u-dev.git gnu-andrew-backport-e47a84f2:gnu-andrew-backport-e47a84f2
$ git checkout gnu-andrew-backport-e47a84f2
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk11u-dev.git gnu-andrew-backport-e47a84f2

Please sign in to comment.