8265500: Some impls of javax.crypto.Cipher.init() do not throw UnsupportedOperationExc for unsupported modes #69
Conversation
…ortedOperationExc for unsupported modes
|
@valeriepeng The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.
default: | ||
// should never happen; checked by Cipher.init() | ||
throw new AssertionError("Unknown mode: " + opmode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This update looks good to me. But there is a potential issues, maybe for all switch statements. If the cipher modes is extended to support more items, we may have to look for and update all the switch uses and make sure there is no broken. Anyway, for my personal understanding, there is nothing we could do right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, if new modes are added, we need to go through all cipher impl and update the switch statements. This change is just to make sure our handling is consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks much for the review~
@valeriepeng This change now passes all automated pre-integration checks. After integration, the commit message for the final commit will be:
You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 18 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.
|
/integrate |
Going to push as commit 80dc262.
Your commit was automatically rebased without conflicts. |
@valeriepeng Pushed as commit 80dc262. |
Could someone please help review this trivial fix? The real changes are the two PKCS11 cipher impl classes under src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/. The rest of classes are just cleanups, e.g. dead code or unused code. The test/jdk/javax/crypto/Cipher/TestCipherMode.java is updated to cover more cipher impls for completeness sake. It passes without this fix, so I only add the bug id to the the other test, i.e. test/jdk/sun/security/pkcs11/Cipher/TestCipherMode.java, which verifies the PKCS#11 cipher impls.
Thanks,
Valerie
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk17 pull/69/head:pull/69
$ git checkout pull/69
Update a local copy of the PR:
$ git checkout pull/69
$ git pull https://git.openjdk.java.net/jdk17 pull/69/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 69
View PR using the GUI difftool:
$ git pr show -t 69
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk17/pull/69.diff