Skip to content

8349583: Add mechanism to disable signature schemes based on their TLS scope#830

Open
jerboaa wants to merge 3 commits into
openjdk:pr/822from
jerboaa:jdk-8349583-disable-signature-schemes-v4
Open

8349583: Add mechanism to disable signature schemes based on their TLS scope#830
jerboaa wants to merge 3 commits into
openjdk:pr/822from
jerboaa:jdk-8349583-disable-signature-schemes-v4

Conversation

@jerboaa

@jerboaa jerboaa commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Unclean backport of JDK-8349583 because some dependencies aren't in 8u. This is a needed backport for JDK-8340321 which we'd like to bring into 8u. The dep missing for this backport is JDK-8226374: Restrict TLS signature schemes and named groups. Getting that in would also require 8171279: Support X25519 and X448 in TLS. So I've omitted it and only added relevant parts of it to make the backport work:

In SignatureScheme:

  • use SigAlgParamSpec signAlgParams over AlgorithmParameterSpec signAlgParameter field.
  • Update usages of getPreferableAlgorithm()
    and getSignerOfPreferableAlgorithm() in:
    CertificateVerify, DHServerKeyExchange, ECDHServerKeyExchange,
    CertificateRequest and CertificateMessage passing in SSLAlgorithmConstraints
    as an extra parameter.
  • Add isPermitted() without the extra bit added by JDK-8226374.
  • Update SignatureUtil.initVerifyWithParam() with the change of the
    signAlgParams field.

The change to java.security-* is duplicated to all OS versions.
Since 8341964: Add mechanism to disable different parts of TLS cipher suite is not
a dependency only include the relevant parts for JDK-8349583 (this patch).

Various test changes to adapt to 8u library code:

  • /test/lib => /lib/testlibrary
  • Utils.java is in jdk.testlibrary.Utils package in 8u.
  • Remove DTLS 1.2 test which isn't supported in 8u TLS 1.3
  • Change usage of Map.ofEntries() which is JDK 11+ only API
  • Change usage of List.of() which is JDK 11+ only API

Other changes:

  • Set.of(x) => Collections.unmodifiableSet(EnumSet.of(x))
  • This change introduces sun.security.ssl.SSLScope enum which is being used in signatures of DisabledAlgorithmConstraints which is being processed during the build for ct.sym creation. Since this tool - and annotation processor - runs on the boot JDK during the build with a modified boot classpath that originally didn't include the new SSLScope class, the processing failed when looking up the class bytes for this class. The fix is to create an extra limited boot classpath that adds this class so that the build also works with an older boot JDK. See second commit.

Testing:

  • jdk/test/javax/net/ssl jdk/test/sun/net/www/protocol/https/ jdk/test/sun/security/ssl/ with these results: Test results: passed: 270; failed: 2; error: 1 Failures are the same as in master.
  • GHA - jdk/security_infra tests are known failures. JDK-8333788 and JDK-8385584


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
  • JDK-8349583 needs maintainer approval
  • Change requires CSR request JDK-8350902 to be approved

Integration blocker

 ⚠️ Dependency #822 must be integrated first

Issues

  • JDK-8349583: Add mechanism to disable signature schemes based on their TLS scope (Enhancement - P2)
  • JDK-8350902: Add mechanism to disable signature schemes based on their TLS scope (CSR)

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk8u-dev.git pull/830/head:pull/830
$ git checkout pull/830

Update a local copy of the PR:
$ git checkout pull/830
$ git pull https://git.openjdk.org/jdk8u-dev.git pull/830/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 830

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk8u-dev/pull/830.diff

Using Webrev

Link to Webrev Comment

8349583: Add mechanism to disable signature schemes based on their TLS scope

Since 'JDK-8226374: Restrict TLS signature schemes and named groups' is
not in 8u, take minimal parts from it to update SignatureScheme:
 - use 'SigAlgParamSpec signAlgParams' over 'AlgorithmParameterSpec
   signAlgParameter' field.
 - Update usages of 'getPreferableAlgorithm()'
   and 'getSignerOfPreferableAlgorithm()' in:
   CertificateVerify, DHServerKeyExchange, ECDHServerKeyExchange,
   CertificateRequest and CertificateMessage passing in SSLAlgorithmConstraints
   as an extra parameter.
 - Add 'isPermitted()' without the extra bit added by JDK-8226374.
 - Update 'SignatureUtil.initVerifyWithParam()' with the change of the
   'signAlgParams' field.

The change to java.security-* is duplicated to all versions.
Since '8341964: Add mechanism to disable different parts of TLS cipher suite' is not
a dependency only include the relevant parts for JDK-8349583.

Various test changes to adapt to 8u library code:
 - /test/lib => /lib/testlibrary
 - Utils.java is in jdk.testlibrary.Utils package in 8u.
 - Remove DTLS 1.2 test which isn't supported in 8u TLS 1.3
 - Change usage of Map.ofEntries() which is only JDK 11+ API
 - Change usage of List.of() which is only in JDK 11+ API

Other changes:
 - Set.of(x) => Collections.unmodifiableSet(EnumSet.of(x))
@bridgekeeper

bridgekeeper Bot commented Jun 10, 2026

Copy link
Copy Markdown

👋 Welcome back sgehwolf! A progress list of the required criteria for merging this PR into pr/822 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 commented Jun 10, 2026

Copy link
Copy Markdown

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk Bot changed the title Backport 257efa5af5d962ef9b10af7123a0db916fd4ef06 8349583: Add mechanism to disable signature schemes based on their TLS scope Jun 10, 2026
@openjdk

openjdk Bot commented Jun 10, 2026

Copy link
Copy Markdown

This backport pull request has now been updated with issue from the original commit.

@openjdk openjdk Bot added the backport Port of a pull request already in a different code base label Jun 10, 2026
jerboaa added 2 commits June 15, 2026 16:29
When ct.sym is being generated by the CreateSymbols annotation
processor, generation fails when trying to process
DisabledAlgorithmConstraints class since SSLScope doesn't exist in the
boot JDK (it's introduced in this patch).

Fix the issue by adding a minimal extra boot class path for the boot JDK
with just the added class. This will no longer be needed once an 8u512
build has been released with the class included in rt.jar
@jerboaa jerboaa force-pushed the jdk-8349583-disable-signature-schemes-v4 branch from 0aee5d0 to 91fcc83 Compare June 15, 2026 14:46
@jerboaa jerboaa marked this pull request as ready for review June 15, 2026 16:48
@openjdk openjdk Bot added the rfr Pull request is ready for review label Jun 15, 2026
@mlbridge

mlbridge Bot commented Jun 15, 2026

Copy link
Copy Markdown

Webrevs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport Port of a pull request already in a different code base rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

1 participant