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

8262186: Call X509KeyManager.chooseClientAlias once for all key types #1885

Closed
wants to merge 2 commits into from

Conversation

GoeLin
Copy link
Member

@GoeLin GoeLin commented Oct 16, 2023

I backport this for parity with 17.0.10-oracle.

The first commit contains the parts applied clean.
The second one contains two chunks I had to resolve, and some additional adaptions.

I had to resolve CertificateRequest.java because "8268199: Correct certificate requests" was already backported to 17, but was applied in head after this change.
This block was in the way of a clean patch:

17u:

              } else {
                    // Any auth object will have a possession generator and
                    // we need to make sure the key types for that generator
                    // share at least one common algorithm with the CR's
                    // allowed key types.
                    if (ka.possessionGenerator instanceof
                            X509PossessionGenerator xpg) {
                        if (Collections.disjoint(crKeyTypes,
                                Arrays.asList(xpg.keyTypes))) {
                            if (SSLLogger.isOn &&
                                    SSLLogger.isOn("ssl,handshake")) {
                                SSLLogger.warning(
                                        "Unsupported authentication scheme: " +
                                                ss.name);
                            }
                            checkedKeyTypes.add(ss.keyAlgorithm);
                            continue;
                        }
                    }
                }

Actually, this block was adapted in the backport of 8268199 because this change, 8262186, was not in 17 at that time.
Also, the adapted code does not compile any more because X509PossessionGenerator is removed by this change.
Thus I changed it to the original code of "8268199: Correct certificate requests":

} else {
                    // Any auth object will have a set of allowed key types.
                    // This set should share at least one common algorithm with
                    // the CR's allowed key types.
                    if (Collections.disjoint(crKeyTypes,
                            Arrays.asList(ka.keyTypes))) {
                        if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) {
                            SSLLogger.warning(
                                    "Unsupported authentication scheme: " +
                                            ss.name);
                        }
                        continue;
                    }
               }

After some further related adaptions the code looks the same in 17 as in head if going back to "8268199: Correct certificate requests".
This is expected as both repos contain the same changes for both resolved files at that point:
17: https://github.com/openjdk/jdk17u-dev/commits/master/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java
head: https://github.com/openjdk/jdk/commits/master/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java

("8271730: Client authentication using RSASSA-PSS ..." brings a chunk to 17 that was lost in the backport of "8268199: Correct certificate requests").

In X509Authentication.java a larger chunk did not apply because the backport of "8268199: Correct certificate requests" removed private statements from the decl of X509PossessionGenerator. The chunk applies clean after undoing this change.

The original issue has a CSR, the backport to 17.0.10-oracle does not. I am investigating why.


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-8262186 needs maintainer approval

Issue

  • JDK-8262186: Call X509KeyManager.chooseClientAlias once for all key types (Bug - P3 - Approved)

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 1885

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

Using diff file

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

Webrev

Link to Webrev Comment

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 16, 2023

👋 Welcome back goetz! 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.

@GoeLin GoeLin changed the title Goetz backport 8262186 Backport 3d657eb0a626e33995af5d5ddf12b26d06317962 Oct 16, 2023
@openjdk openjdk bot changed the title Backport 3d657eb0a626e33995af5d5ddf12b26d06317962 8262186: Call X509KeyManager.chooseClientAlias once for all key types Oct 16, 2023
@openjdk
Copy link

openjdk bot commented Oct 16, 2023

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

@openjdk openjdk bot added backport rfr Pull request is ready for review labels Oct 16, 2023
@mlbridge
Copy link

mlbridge bot commented Oct 16, 2023

Webrevs

@openjdk
Copy link

openjdk bot commented Oct 19, 2023

⚠️ @GoeLin This change is now ready for you to apply for maintainer approval. This can be done directly in each associated issue or by using the /approval command.

@bridgekeeper
Copy link

bridgekeeper bot commented Nov 16, 2023

@GoeLin 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 add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

@openjdk openjdk bot added the approval label Nov 20, 2023
@openjdk
Copy link

openjdk bot commented Nov 21, 2023

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

8262186: Call X509KeyManager.chooseClientAlias once for all key types

Reviewed-by: phh

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

  • db83123: 8316645: RISC-V: Remove dependency on libatomic by adding cmpxchg 1b
  • 9bde50e: 8319958: test/jdk/java/io/File/libGetXSpace.c does not compile on Windows 32-bit
  • c7fb6ea: 8318759: Add four DigiCert root certificates
  • e0bdb10: 8307311: Timeouts on one macOS 12.6.1 host of two Swing JTableHeader tests
  • 8860bde: 8294402: Add diagnostic logging to VMProps.checkDockerSupport
  • 68f7295: 8315195: RISC-V: Update hwprobe query for new extensions
  • 49d5323: 8319184: RISC-V: improve MD5 intrinsic
  • 74d8e49: 8285785: CheckCleanerBound test fails with PasswordCallback object is not released
  • df82c1c: 8268433: serviceability/dcmd/framework/VMVersionTest.java fails with Unable to send object throw not established PipeIO Listener Thread connection
  • 0cdcc13: 8312126: NullPointerException in CertStore.getCRLs after 8297955
  • ... and 85 more: https://git.openjdk.org/jdk17u-dev/compare/c17878a93b6b2c52380f8240a88f463adadba1c2...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 ready Pull request is ready to be integrated and removed approval labels Nov 21, 2023
@GoeLin
Copy link
Member Author

GoeLin commented Nov 21, 2023

/integrate

@openjdk
Copy link

openjdk bot commented Nov 21, 2023

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

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Nov 21, 2023

@GoeLin Pushed as commit 2a37bae.

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

@GoeLin GoeLin deleted the goetz_backport_8262186 branch November 21, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport integrated Pull request has been integrated
2 participants