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

JDK-8295405 : Add cause in a couple of IllegalArgumentException and InvalidParameterException shown by sun/security/pkcs11 tests #10726

Closed
wants to merge 3 commits into from

Conversation

MBaesken
Copy link
Member

@MBaesken MBaesken commented Oct 17, 2022

We have a number of failing sun/security/pkcs11 test on RHEL 8.6, see

https://bugs.openjdk.org/browse/JDK-8295343
8295343 : sun/security/pkcs11 tests fail on Linux RHEL 8.6

The exceptions generated by these tests sometimes miss the cause (causing exception), it would be nice to have this added to get the complete exception backtrace.


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8295405: Add cause in a couple of IllegalArgumentException and InvalidParameterException shown by sun/security/pkcs11 tests

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/10726/head:pull/10726
$ git checkout pull/10726

Update a local copy of the PR:
$ git checkout pull/10726
$ git pull https://git.openjdk.org/jdk pull/10726/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 10726

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/10726.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 17, 2022

👋 Welcome back mbaesken! 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 Oct 17, 2022
@openjdk
Copy link

openjdk bot commented Oct 17, 2022

@MBaesken 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 Oct 17, 2022
@mlbridge
Copy link

mlbridge bot commented Oct 17, 2022

Webrevs

@mcpowers
Copy link
Contributor

There are several other files in the pkcs11 directory where cause is missing from the thrown exception. Might as well fix them all.

@MBaesken
Copy link
Member Author

There are several other files in the pkcs11 directory where cause is missing from the thrown exception. Might as well fix them all.

Hi, I first focused on the exceptions I saw when looking into 8295343 (issues with some pkcs11 related tests on RHEL 8).
But indeed there are a couple other exceptions where the cause is missing.

Copy link
Contributor

@TheRealMDoerr TheRealMDoerr left a comment

Choose a reason for hiding this comment

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

Change looks good. Does it need a CSR?

@openjdk
Copy link

openjdk bot commented Oct 26, 2022

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

8295405: Add cause in a couple of IllegalArgumentException and InvalidParameterException shown by sun/security/pkcs11 tests

Reviewed-by: mdoerr, mullan

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

  • 2157145: 8293858: Change PKCS7 code to use default SecureRandom impl instead of SHA1PRNG
  • b8ad6cd: 8294461: wrong effectively final determination by javac
  • d667895: 8294399: (ch) Refactor some methods out of sun.nio.ch.UnixFileDispatcherImpl
  • 628820f: 8283093: JMX connections should default to using an ObjectInputFilter
  • 521e712: 8286431: Do not use resource array in posix mmap_attach_shared()
  • 4d9a1cd: 8292159: TYPE_USE annotations on generic type arguments of record components discarded
  • 210fe49: 6244831: JFileChooser does not have tooltip for Desktop, Recent etc ToggleButton on Windows Look and feel
  • c2d7a35: 8269235: serviceability/sa/ClhsdbJstackXcompStress.java timed out
  • 58a7141: 8295066: Folding of loads is broken in C2 after JDK-8242115
  • a8450b3: 8295713: runtime/ParallelLoad/SuperWait/SuperWaitTest.java fails intermittently on Windows
  • ... and 151 more: https://git.openjdk.org/jdk/compare/172006c0e9433046252bd79e8864890ab7c0ce56...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 26, 2022
@MBaesken
Copy link
Member Author

Change looks good. Does it need a CSR?

Hi Martin , from what I read here https://wiki.openjdk.org/display/csr/CSR+FAQs no CSR is needed. But I am no expert on the topic so maybe someone else has an opinion on this ?

While looking at this change, I considered adding a constructor (String,Throwable) to InvalidAlgorithmParameterException and use it in security coding to simplify coding, but I did not do this in this change; I think adding a constructor (String,Throwable) to InvalidAlgorithmParameterException would indeed need a CSR .

@seanjmullan
Copy link
Member

Change looks good. Does it need a CSR?

Hi Martin , from what I read here https://wiki.openjdk.org/display/csr/CSR+FAQs no CSR is needed. But I am no expert on the topic so maybe someone else has an opinion on this ?

It does not require a CSR.

While looking at this change, I considered adding a constructor (String,Throwable) to InvalidAlgorithmParameterException and use it in security coding to simplify coding, but I did not do this in this change; I think adding a constructor (String,Throwable) to InvalidAlgorithmParameterException would indeed need a CSR .

I think you mean InvalidParameterException. InvalidAlgorithmParameterException has a ctor that takes a cause. Can you file an RFE?

Note: I don't know if there is much benefit to specifying the exception message as the first argument, but I'm ok with leaving this as is if you want to avoid too many changes. For example:

throw new IllegalArgumentException(e.getMessage(), e)

Maybe we should just change these to:

throw new IllegalArgumentException(e)

I think the main benefit is that you get a localized message, if applicable.

@MBaesken
Copy link
Member Author

I think you mean InvalidParameterException. InvalidAlgorithmParameterException has a ctor that takes a cause. Can you file an RFE?

Sorry I meant indeed InvalidParameterException .
But I plan to propose this in another JBS issue not this one.

Thanks, Matthias

@MBaesken
Copy link
Member Author

Hi Martin and Sean, thanks for the reviews !

@MBaesken
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Oct 28, 2022

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

  • fd668dc: 8295537: Enhance TRACE_METHOD_LINKAGE to show the target MethodHandle
  • 182c215: 8295994: Remove left over InetAddressContainer class
  • 78763fc: 8295000: java/util/Formatter/Basic test cleanup
  • 907d583: 8295323: Unnecessary HashTable usage in StyleSheet
  • 2157145: 8293858: Change PKCS7 code to use default SecureRandom impl instead of SHA1PRNG
  • b8ad6cd: 8294461: wrong effectively final determination by javac
  • d667895: 8294399: (ch) Refactor some methods out of sun.nio.ch.UnixFileDispatcherImpl
  • 628820f: 8283093: JMX connections should default to using an ObjectInputFilter
  • 521e712: 8286431: Do not use resource array in posix mmap_attach_shared()
  • 4d9a1cd: 8292159: TYPE_USE annotations on generic type arguments of record components discarded
  • ... and 155 more: https://git.openjdk.org/jdk/compare/172006c0e9433046252bd79e8864890ab7c0ce56...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot added the integrated Pull request has been integrated label Oct 28, 2022
@openjdk openjdk bot closed this Oct 28, 2022
@openjdk openjdk bot removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Oct 28, 2022
@openjdk
Copy link

openjdk bot commented Oct 28, 2022

@MBaesken Pushed as commit d5d3424.

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

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
Development

Successfully merging this pull request may close these issues.

4 participants