8386473: DESKeySpec and DESedeKeySpec may throw InvalidKeyException instead of ArrayIndexOutOfBoundsException for Integer.MIN_VALUE offset#31494
Open
smemery wants to merge 3 commits into
Open
Conversation
…nstead of ArrayIndexOutOfBoundsException for Integer.MIN_VALUE offset
|
👋 Welcome back semery! A progress list of the required criteria for merging this PR into |
|
@smemery This change is no longer ready for integration - check the PR body for details. |
Webrevs
|
seanjmullan
approved these changes
Jun 12, 2026
Contributor
Author
|
/integrate |
sendaoYan
reviewed
Jun 13, 2026
| boolean weak = DESKeySpec.isWeak(strongKey, Integer.MIN_VALUE); | ||
| throw new Exception("expected ArrayIndexOutOfBoundsException"); | ||
| } catch (ArrayIndexOutOfBoundsException aiobe) {} | ||
| try{ |
Member
There was a problem hiding this comment.
There are several try{ missed a whitespace
Contributor
Author
There was a problem hiding this comment.
Fixed in latest delta.
sendaoYan
reviewed
Jun 13, 2026
| * @summary DESKeySpec.isWeak should throw aiobe exception if the offset is | ||
| * negative. | ||
| * @bug 8364121 8386473 | ||
| * @summary Test DES[ede]KeySpec for negative and integer overflow offsets | ||
| */ | ||
| import java.security.InvalidKeyException; |
Member
There was a problem hiding this comment.
'import InvalidKeyException' seems useless.
Contributor
Author
There was a problem hiding this comment.
Good catch, removed.
sendaoYan
approved these changes
Jun 14, 2026
Contributor
Author
|
/integrate |
|
@smemery This pull request has not yet been marked as ready for integration. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fix includes throwing the correct exception when an offset for the key length check would cause an integer overflow therefore throwing the wrong exception.
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/31494/head:pull/31494$ git checkout pull/31494Update a local copy of the PR:
$ git checkout pull/31494$ git pull https://git.openjdk.org/jdk.git pull/31494/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 31494View PR using the GUI difftool:
$ git pr show -t 31494Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/31494.diff
Using Webrev
Link to Webrev Comment