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

7192189: Support endpoint identification algorithm in RFC 6125 #7697

Closed
wants to merge 2 commits into from

Conversation

seanjmullan
Copy link
Member

@seanjmullan seanjmullan commented Mar 4, 2022

Please review this change to fully support RFC 6125 in the TLS implementation. This change forbids wildcard domains in TLS certificates unless the wildcard is in the left-most component. Certificates of this nature should be rare and are not allowed per the CABForum baseline requirements. However there may be a small compatibility risk associated with this change, so a CSR has also been filed.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed
  • Change requires a CSR request to be approved

Issues

  • JDK-7192189: Support endpoint identification algorithm in RFC 6125
  • JDK-8282630: Support endpoint identification algorithm in RFC 6125 (CSR)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/7697/head:pull/7697
$ git checkout pull/7697

Update a local copy of the PR:
$ git checkout pull/7697
$ git pull https://git.openjdk.java.net/jdk pull/7697/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 7697

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

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/7697.diff

@seanjmullan
Copy link
Member Author

/csr

@bridgekeeper
Copy link

bridgekeeper bot commented Mar 4, 2022

👋 Welcome back mullan! 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 csr Pull request needs approved CSR before integration rfr Pull request is ready for review labels Mar 4, 2022
@openjdk
Copy link

openjdk bot commented Mar 4, 2022

@seanjmullan an approved CSR request is already required for this pull request.

@openjdk
Copy link

openjdk bot commented Mar 4, 2022

@seanjmullan 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 Mar 4, 2022
@mlbridge
Copy link

mlbridge bot commented Mar 4, 2022

Webrevs

@XueleiFan
Copy link
Member

About the CSR, did you have a plan to update the "Endpoint Identification Algorithms" in the Java Security Standard Algorithm Names documentation? Currently, the "HTTPS" name is defined for RFC 2818. With this update is may be worth to mention the compliant to RFC 6125, like

HTTPS | RFC 2818, compliant with RFC 6125

@seanjmullan
Copy link
Member Author

About the CSR, did you have a plan to update the "Endpoint Identification Algorithms" in the Java Security Standard Algorithm Names documentation? Currently, the "HTTPS" name is defined for RFC 2818. With this update is may be worth to mention the compliant to RFC 6125, like

HTTPS | RFC 2818, compliant with RFC 6125

I thought about that but I was hesitant to do that, because technically RFC 6125 does not obsolete RFC 2818 and there has been no successor to RFC 2818. So I would rather treat RFC 6125 as an implementation-specific feature of the JDK TLS implementation; in other words we chose to make our implementation compliant with RFC 6125 but other implementations may choose not to and still be compliant with RFC 2818. Since RFC 2818 is somewhat ambiguous/vague with respect to what components can use wildcards, I believe the JDK implementation is still compliant with 2818. I realize this is not a perfect situation, but if we do this via the API, then I think we need new APIs such that older implementations that may be less strict about wildcards are still compatible with 2818 if they choose.

@XueleiFan
Copy link
Member

About the CSR, did you have a plan to update the "Endpoint Identification Algorithms" in the Java Security Standard Algorithm Names documentation? Currently, the "HTTPS" name is defined for RFC 2818. With this update is may be worth to mention the compliant to RFC 6125, like

HTTPS | RFC 2818, compliant with RFC 6125

I thought about that but I was hesitant to do that, because technically RFC 6125 does not obsolete RFC 2818 and there has been no successor to RFC 2818. So I would rather treat RFC 6125 as an implementation-specific feature of the JDK TLS implementation; in other words we chose to make our implementation compliant with RFC 6125 but other implementations may choose not to and still be compliant with RFC 2818. Since RFC 2818 is somewhat ambiguous/vague with respect to what components can use wildcards, I believe the JDK implementation is still compliant with 2818. I realize this is not a perfect situation, but if we do this via the API, then I think we need new APIs such that older implementations that may be less strict about wildcards are still compatible with 2818 if they choose.

It makes sense to me.

checker.match(domain, mock(wildcardedDomain));
} catch (Exception e) {
if (expected) {
throw new Exception("unexpectedly failed match", e);
Copy link
Member

Choose a reason for hiding this comment

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

consider to update these to RuntimeException

Copy link
Member Author

Choose a reason for hiding this comment

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

What are the benefits of throwing RuntimeException instead of Exception? In the latest commit, I have merged the Wildcard.java test into TestHostnameChecker.java test which already throws Exception on failures.

Copy link
Member

Choose a reason for hiding this comment

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

It's not essential. RuntimeException is a convenient choice since it's unchecked, so you don't have to sprinkle your code with throws clauses.

https://openjdk.java.net/jtreg/faq.html#if-a-test-fails-do-i-have-to-throw-my-own-exception

@openjdk openjdk bot removed the csr Pull request needs approved CSR before integration label Mar 8, 2022
@openjdk
Copy link

openjdk bot commented Mar 8, 2022

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

7192189: Support endpoint identification algorithm in RFC 6125

Reviewed-by: xuelei, rhalade

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

  • 288d1af: 8282715: typo compileony in test Test8005033.java
  • 6b34884: 8282234: Create a regression test for JDK-4532513
  • 3fc009b: 8281560: Matcher.hitEnd returns unexpected results in presence of CANON_EQ flag.
  • 2549e55: 8275640: (win) java.net.NetworkInterface issues with IPv6-only environments
  • 3e4dfc6: 8282295: SymbolPropertyEntry::set_method_type fails with assert
  • 0cbc4b8: 8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly
  • 0f88fc1: 8282769: BSD date cannot handle all ISO 8601 formats
  • c6d743f: 8282770: Set source date in jib profiles from buildId
  • 5fab27e: 8282144: RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes
  • 65ca0a5: 8276333: jdk/jfr/event/oldobject/TestLargeRootSet.java failed "assert(!contains(edge->reference())) failed: invariant"
  • ... and 31 more: https://git.openjdk.java.net/jdk/compare/52471539c002e38a5c815045913458776381d369...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 Mar 8, 2022
Rename HostnameMatcher dir to HostnameChecker.
@seanjmullan
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Mar 8, 2022

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

  • 288d1af: 8282715: typo compileony in test Test8005033.java
  • 6b34884: 8282234: Create a regression test for JDK-4532513
  • 3fc009b: 8281560: Matcher.hitEnd returns unexpected results in presence of CANON_EQ flag.
  • 2549e55: 8275640: (win) java.net.NetworkInterface issues with IPv6-only environments
  • 3e4dfc6: 8282295: SymbolPropertyEntry::set_method_type fails with assert
  • 0cbc4b8: 8281266: [JVMCI] MetaUtil.toInternalName() doesn't handle hidden classes correctly
  • 0f88fc1: 8282769: BSD date cannot handle all ISO 8601 formats
  • c6d743f: 8282770: Set source date in jib profiles from buildId
  • 5fab27e: 8282144: RandomSupport.convertSeedBytesToLongs sign extension overwrites previous bytes
  • 65ca0a5: 8276333: jdk/jfr/event/oldobject/TestLargeRootSet.java failed "assert(!contains(edge->reference())) failed: invariant"
  • ... and 31 more: https://git.openjdk.java.net/jdk/compare/52471539c002e38a5c815045913458776381d369...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented Mar 8, 2022

@seanjmullan Pushed as commit 72e987e.

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

@dcubed-ojdk
Copy link
Member

I'm not seeing any indication in this PR documenting how this fix was tested.
It appears to have caused a Tier2 test to fail on all platforms:

JDK-8282832 sun/security/util/Pem/encoding.sh failed with "FileNotFoundException: .../open/test/jdk/sun/security/util/Pem/../HostnameMatcher/cert5.crt (No such file or directory)"
https://bugs.openjdk.java.net/browse/JDK-8282832

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
4 participants