-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8359956: Support algorithm constraints and certificate checks in SunX509 key manager #25016
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
…g checked with default SunX509 key manager
👋 Welcome back abarashev! A progress list of the required criteria for merging this PR into |
@artur-oracle 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 107 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 |
@artur-oracle The following labels 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 lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
It is nice to refactor the common code for algorithm constraints checking into a new class, |
@haimaychao Thanks for looking into it! Yes, it will disable constraints checking for both key managers and I did it this way on purpose. I think it will be simpler and less confusing to the end users. This system property is off by default and my assumption is that if end users want to disable KM algorithm constraints checking they would expect it to be disabled system-wide. @seanjmullan What do you think? |
/issue add JDK-8170706 |
@artur-oracle |
System.setProperty( | ||
"jdk.tls.SunX509keymanager.certSelectionChecking", "false"); |
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.
What if you instead just removed "RSA keySize < 1024" from the jdk.certpath.disabledAlgorithms
security property - would this test still pass? This way you could still test the other parts of the cert selection code.
This same comment applies to other tests where you have set the jdk.tls.SunX509keymanager.certSelectionChecking
property to false.
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.
Done, good point! It works for this particular test but the same approach doesn't work for other tests because they either rely on TrustManager do the constraints checks or MD5 algorithm being blocks by TLSv1.3 spec.
/csr |
Please create a CSR for the new system property. |
@seanjmullan has indicated that a compatibility and specification (CSR) request is needed for this pull request. @artur-oracle please create a CSR request for issue JDK-8359956 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
@artur-oracle This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply issue a |
test/jdk/sun/security/ssl/SignatureScheme/MD5NotAllowedInTLS13CertificateSignature.java
Outdated
Show resolved
Hide resolved
test/jdk/sun/security/ssl/X509TrustManagerImpl/PKIXExtendedTM.java
Outdated
Show resolved
Hide resolved
src/java.base/share/classes/sun/security/ssl/X509KeyManagerCertChecking.java
Show resolved
Hide resolved
/integrate |
Going to push as commit e544cd9.
Your commit was automatically rebased without conflicts. |
@artur-oracle Pushed as commit e544cd9. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
Hi I found that |
Hi! It's already fixed. |
SunX509 key manager should support the same certificate checks that are supported by PKIX key manager.
Effectively there should be only 2 differences between 2 key managers:
SUNX509 KeyManager performance before the change
Benchmark (resume) (tlsVersion) Mode Cnt Score Error Units
SSLHandshake.doHandshake true TLSv1.2 thrpt 15 19758.012 ± 758.237 ops/s
SSLHandshake.doHandshake true TLS thrpt 15 1861.695 ± 14.681 ops/s
SSLHandshake.doHandshake false TLSv1.2 thrpt 15 1186.962 ± 12.085 ops/s
SSLHandshake.doHandshake false TLS thrpt 15 1056.288 ± 7.197 ops/s
SUNX509 KeyManager performance after the change
Benchmark (resume) (tlsVersion) Mode Cnt Score Error Units
SSLHandshake.doHandshake true TLSv1.2 thrpt 15 20954.399 ± 260.817 ops/s
SSLHandshake.doHandshake true TLS thrpt 15 1813.401 ± 13.917 ops/s
SSLHandshake.doHandshake false TLSv1.2 thrpt 15 1158.190 ± 6.023 ops/s
SSLHandshake.doHandshake false TLS thrpt 15 1012.988 ± 10.943 ops/s
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/25016/head:pull/25016
$ git checkout pull/25016
Update a local copy of the PR:
$ git checkout pull/25016
$ git pull https://git.openjdk.org/jdk.git pull/25016/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 25016
View PR using the GUI difftool:
$ git pr show -t 25016
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/25016.diff
Using Webrev
Link to Webrev Comment