-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
8285404: RSA signature verification should reject non-DER OCTET STRING #8365
Conversation
👋 Welcome back weijun! A progress list of the required criteria for merging this PR into |
Webrevs
|
Mailing list message from Michael StJohns on security-dev: On 4/22/2022 1:21 PM, Weijun Wang wrote: This is a weird one.? AFAICT the way it was being done is valid and
-------------- next part -------------- |
Yes, I saw the "Note". It's definitely OK to decode but one has to make sure the input is DER encoded. Unfortunately, the old |
Regardless whether we ended up with decode/encode, we should make sure RSASSA-PSS signature impl is also covered and consistent. |
byte[] decrypted = RSACore.rsa(sigBytes, publicKey); | ||
byte[] unpadded = padding.unpad(decrypted); |
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.
It looks like safer to me that decodeSignature() method is removed and the same method get used for the verification.
Maybe, these two lines could be moved ahead (at line 215) so that the processing order is consistent with the RFC 8017 described order, for readability.
RSASSA-PSS is not affected. Neither with the PKCS11 RSA signature. |
Mailing list message from xueleifan(XueleiFan) on security-dev: With this update, is the purpose of this PR changed? The bug subject and description may need an update. Xuelei |
Good catch. I'll reword. |
Never mind, PSS has its own way of verification and its impl is based on RFC 8017. |
@wangweij This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. 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 68 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. ➡️ To integrate this PR with the above commit message to the |
/integrate |
Going to push as commit 14e7d91.
Your commit was automatically rebased without conflicts. |
Compare encoded instead of decoded digest in RSA signature verification.
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/8365/head:pull/8365
$ git checkout pull/8365
Update a local copy of the PR:
$ git checkout pull/8365
$ git pull https://git.openjdk.java.net/jdk pull/8365/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 8365
View PR using the GUI difftool:
$ git pr show -t 8365
Using diff file
Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/8365.diff