Skip to content
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

8274471: Verification of OCSP Response signed with RSASSA-PSS fails #5778

Closed
wants to merge 3 commits into from

Conversation

wangweij
Copy link
Contributor

@wangweij wangweij commented Sep 30, 2021

Extra parameters need to be set for RSASSA-PSS signatures. We already have a helper method for that.

Some other cleanups:

  1. When using GET for OCSP, make sure no double slash.
  2. Several throws clauses are not necessary.

No regression test. OCSP needs to access an external server.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8274471: Verification of OCSP Response signed with RSASSA-PSS fails

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5778/head:pull/5778
$ git checkout pull/5778

Update a local copy of the PR:
$ git checkout pull/5778
$ git pull https://git.openjdk.java.net/jdk pull/5778/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5778

View PR using the GUI difftool:
$ git pr show -t 5778

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5778.diff

8274471: Verification of OCSP Response signed with RSASSA-PSS fails
@bridgekeeper
Copy link

bridgekeeper bot commented Sep 30, 2021

👋 Welcome back weijun! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 30, 2021
@openjdk
Copy link

openjdk bot commented Sep 30, 2021

@wangweij The following label will be automatically applied to this pull request:

  • security

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.

@openjdk openjdk bot added the security security-dev@openjdk.org label Sep 30, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 30, 2021

Webrevs

Copy link
Contributor

@haimaychao haimaychao left a comment

As throwing ProviderException is removed from initVerifyWithParam(), could we remove the ProviderException in the try-catch block from the callers of initVerifyWithParam()? For example, one of the callers at:
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java#L476

@wangweij
Copy link
Contributor Author

wangweij commented Oct 1, 2021

As throwing ProviderException is removed from initVerifyWithParam(), could we remove the ProviderException in the try-catch block from the callers of initVerifyWithParam()? For example, one of the callers at:
https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/sun/security/pkcs/SignerInfo.java#L476

ProviderException is a RuntimeException, so removing it from the method signature does not mean the method will not throw it. Therefore, removing those catch blocks might lead to behavior changes. I'd rather not touch them.

@wangweij
Copy link
Contributor Author

wangweij commented Oct 1, 2021

New commit to disallow a verifier Signature be created directly from algorithm and key and initialized with a default parameters. For verifiers, params must be provided explicitly (if needed); otherwise, it's an error. Fortunately no code is using this function at the moment.

Copy link
Contributor

@haimaychao haimaychao left a comment

Looks good.

jnimeh
jnimeh approved these changes Oct 4, 2021
Copy link
Member

@jnimeh jnimeh left a comment

Looks good. I like the algorithm agility enhancements to SimpleOCSPServer and CertificateBuilder.

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@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:

8274471: Verification of OCSP Response signed with RSASSA-PSS fails

Reviewed-by: hchao, jnimeh

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 83 new commits pushed to the master branch:

  • f2404d6: 8274658: ISO 4217 Amendment 170 Update
  • 7eb0372: 8274606: Fix jaxp/javax/xml/jaxp/unittest/transform/SurrogateTest.java test
  • 47bfc8a: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • 0828273: 8274521: jdk/jfr/event/gc/detailed/TestGCLockerEvent.java fails when other GC is selected
  • 6726c59: 8274634: Use String.equals instead of String.compareTo in java.desktop
  • 3281102: 8268084: [macos] Disabled JMenuItem arrow is not disabled
  • 7957994: 8273695: Safepoint deadlock on VMOperation_lock
  • 9ca6bf0: 8274505: Too weak variable type leads to unnecessary cast in java.desktop
  • 0786d8b: 8268435: (ch) ChannelInputStream could override readAllBytes
  • bb4500d: 8274465: Fix javax/swing/text/ParagraphView/6364882/bug6364882.java failures
  • ... and 73 more: https://git.openjdk.java.net/jdk/compare/7700b25460b9898060602396fed7bc590ba242b8...master

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 master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Oct 4, 2021
@wangweij
Copy link
Contributor Author

wangweij commented Oct 4, 2021

/integrate

@openjdk
Copy link

openjdk bot commented Oct 4, 2021

Going to push as commit f63c4a8.
Since your change was applied there have been 83 commits pushed to the master branch:

  • f2404d6: 8274658: ISO 4217 Amendment 170 Update
  • 7eb0372: 8274606: Fix jaxp/javax/xml/jaxp/unittest/transform/SurrogateTest.java test
  • 47bfc8a: 8274563: jfr/event/oldobject/TestClassLoaderLeak.java fails when GC cycles are not happening
  • 0828273: 8274521: jdk/jfr/event/gc/detailed/TestGCLockerEvent.java fails when other GC is selected
  • 6726c59: 8274634: Use String.equals instead of String.compareTo in java.desktop
  • 3281102: 8268084: [macos] Disabled JMenuItem arrow is not disabled
  • 7957994: 8273695: Safepoint deadlock on VMOperation_lock
  • 9ca6bf0: 8274505: Too weak variable type leads to unnecessary cast in java.desktop
  • 0786d8b: 8268435: (ch) ChannelInputStream could override readAllBytes
  • bb4500d: 8274465: Fix javax/swing/text/ParagraphView/6364882/bug6364882.java failures
  • ... and 73 more: https://git.openjdk.java.net/jdk/compare/7700b25460b9898060602396fed7bc590ba242b8...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Oct 4, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 4, 2021
@openjdk
Copy link

openjdk bot commented Oct 4, 2021

@wangweij Pushed as commit f63c4a8.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@wangweij wangweij deleted the 8274471 branch Oct 5, 2021
@mlbridge
Copy link

mlbridge bot commented Oct 5, 2021

Mailing list message from can comert on security-dev:

I have seen the issue is already fixed and will be available for the JDK 18.
Thank you very much for your great work and fast response!

Is there any backporting for a LTS version planned?

Best Regards,
Can

4 Eki 2021 Pzt 17:34 tarihinde Weijun Wang <weijun at openjdk.java.net> ?unu
yazd?:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20211005/467b6d02/attachment.htm>

@mlbridge
Copy link

mlbridge bot commented Oct 5, 2021

Mailing list message from Wei-Jun Wang on security-dev:

I think it's worth backporting to older LTS releases. Will ask sustaining on it.

Thanks,
Weijun

On Oct 5, 2021, at 2:36 PM, can comert <cancomert at gmail.com> wrote:

Is there any backporting for a LTS version planned?

@mlbridge
Copy link

mlbridge bot commented Oct 11, 2021

Mailing list message from can comert on security-dev:

Thank you very much!

Regards,
Can

Wei-Jun Wang <weijun.wang at oracle.com>, 5 Eki 2021 Sal, 22:05 tarihinde ?unu
yazd?:

I think it's worth backporting to older LTS releases. Will ask sustaining
on it.

Thanks,
Weijun

On Oct 5, 2021, at 2:36 PM, can comert <cancomert at gmail.com> wrote:

Is there any backporting for a LTS version planned?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/security-dev/attachments/20211011/1d94eabb/attachment.htm>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated security security-dev@openjdk.org
3 participants