8261289: Incorrect cleanup in LDAP TLS handling#30547
Open
jaikiran wants to merge 1 commit intoopenjdk:masterfrom
Open
8261289: Incorrect cleanup in LDAP TLS handling#30547jaikiran wants to merge 1 commit intoopenjdk:masterfrom
jaikiran wants to merge 1 commit intoopenjdk:masterfrom
Conversation
|
👋 Welcome back jpai! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Can I please get a review of this change which proposes to address the issue noted in https://bugs.openjdk.org/browse/JDK-8261289?
The JDK's implementation of the
LdapContextallows for the LDAPv3 Extended Response for StartTLS.LdapContext.extendedOperation(new StartTlsRequest())can be invoked by an application to obtain aStartTlsResponsewhich can then be used toStartTlsResponse.negotiate()a TLS session. A successful TLS negotiation will result in the underlying LDAP connection's input/output streams being switched to TLS specific streams. Any subsequent communication over the LDAP context will happen over these TLS streams, until theStartTlsResponse.close()is called.One part of TLS negotiation involves certificate verification. In the JDK's implementation of
StartTlsResponse, if the certificate verification fails (for whatever reason) after the LDAP connection's streams have been switched to TLS specific streams, then these streams must be switched back to the original streams that were present before the TLS negotiation was attempted. However, due to a bug, this currently doesn't happen and after a failed TLS negotiation, subsequent communication over the LDAP connection (which is allowed) continues to use these TLS streams.The commit in this PR addresses that issue in the implementation of
StartTlsResponse. Minor related clean up is done to that implementation to properly handle exceptions. A new jtreg test has been introduced to reproduce the issue and verify the fix.tier1, tier2, tier3 tests continue to pass with this change.
Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30547/head:pull/30547$ git checkout pull/30547Update a local copy of the PR:
$ git checkout pull/30547$ git pull https://git.openjdk.org/jdk.git pull/30547/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 30547View PR using the GUI difftool:
$ git pr show -t 30547Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30547.diff
Using Webrev
Link to Webrev Comment