-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8312428: PKCS11 tests fail with NSS 3.91 #15217
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
Conversation
|
👋 Welcome back valeriep! A progress list of the required criteria for merging this PR into |
|
@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. |
Webrevs
|
|
|
||
| public static boolean isSignatureSupported(Provider p) { | ||
| try { | ||
| Signature.getInstance("RSASSA-PSS", p); |
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 can use the SIGALG constant name.
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.
Sure
| /* | ||
| * @test | ||
| * @bug 6414899 8242332 | ||
| * @bug 6414899 8242332 8312428 |
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.
No need to add bug id for test only updates.
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.
Ok.
| sig = Signature.getInstance(SIGALG, p); | ||
| } catch (NoSuchAlgorithmException e) { | ||
| if (!PSSUtil.isSignatureSupported(p)) { | ||
| System.out.println("Skip testing RSASSA-PSS" + |
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.
Update to throw SkippedException.
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.
Ok
| sig.initSign(priv); | ||
| System.out.println("test#1: pass"); | ||
| sig.initVerify(pub); | ||
| System.out.println("test#2: good params pass"); |
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.
Either add a test#1 message after initSign test or update this to remove #2
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.
test#1 message matches with test#2 ones. Anyway, I removed the test output messages with your comments.
| sig = Signature.getInstance(SIGALG, p); | ||
| } catch (NoSuchAlgorithmException e) { | ||
| if (!PSSUtil.isSignatureSupported(p)) { | ||
| System.out.println("Skip testing RSASSA-PSS" + |
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.
throw SkippedException here.
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.
Ok. I initially thought that the SkippedException only applies to library not found and/or un-configured OS. With this extension of the meaning of SkippedException, many of the existing tests have to be updated to match.
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.
Yes, I did #1 update with JDK-8313206 and plan to do update more scenarios with JDK-8313575
| String sigAlg = (h.startsWith("SHA3-")? | ||
| h : h.replace("-","")) + "withRSASSA-PSS"; |
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.
| String sigAlg = (h.startsWith("SHA3-")? | |
| h : h.replace("-","")) + "withRSASSA-PSS"; | |
| String sigAlg = (h.startsWith("SHA3-") ? | |
| h : h.replace("-", "")) + "withRSASSA-PSS"; |
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.
Ok.
|
Can you please also update https://github.com/openjdk/jdk/blob/master/test/jdk/sun/security/pkcs11/PKCS11Test.java#L1002 to use 3.91? |
| sig = Signature.getInstance(SIGALG, p); | ||
| } catch (NoSuchAlgorithmException e) { | ||
| if (!PSSUtil.isSignatureSupported(p)) { | ||
| System.out.println("Skip testing RSASSA-PSS" + |
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.
Yes, I did #1 update with JDK-8313206 and plan to do update more scenarios with JDK-8313575
Are you suggesting to use 3.91 for all the OS configurations? |
|
Ok, lets address this update in a separate bug after validating all platforms. |
Sounds good to me. |
| // confirmed to be unsupported; skip the rest of the test | ||
| System.out.println("=> Skip; no PSS support"); | ||
| return; | ||
| } |
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.
else...Should the test be marked as failed?
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.
Sure, should not happen but good to check to be sure.
| // confirmed to be unsupported; skip the rest of the test | ||
| System.out.println(" => Skip; no PSS support"); | ||
| return; | ||
| } |
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.
Same here, should test fail here?
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.
Sure.
|
@valeriepeng 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 221 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 1c598c2.
Your commit was automatically rebased without conflicts. |
|
@valeriepeng Pushed as commit 1c598c2. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Starting NSS v3.91, SHA-3 support is added for MessageDigest but not for PSS Signature. This breaks existing test assumptions made by PSS regression tests. In addition, the NSS SHA-3 message digests do not support cloning which causes the failure of TestCloning.java.
This PR adds a PSSUtil.java class which provides utility method for detecting/guessing whether a digest algorithm is valid for PSS signature or not.
The changes are verified with NSS v3.46, v3.57 and v3.91 (on local Linux machine).
Thanks in advance for review~
Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15217/head:pull/15217$ git checkout pull/15217Update a local copy of the PR:
$ git checkout pull/15217$ git pull https://git.openjdk.org/jdk.git pull/15217/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15217View PR using the GUI difftool:
$ git pr show -t 15217Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15217.diff
Webrev
Link to Webrev Comment