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

8273646: Add openssl from path variable also in to Default System Openssl Path in OpensslArtifactFetcher #5523

Closed
wants to merge 2 commits into from

Conversation

@thejasviv
Copy link
Member

@thejasviv thejasviv commented Sep 15, 2021

The test "sun/security/pkcs12/KeytoolOpensslInteropTest.java" performs interoperability checks between JDK and openssl with respect to certain keystore operations. The test requires a suitable version of openssl to be available on the machine it runs. Some mechanisms are used to discover openssl, among which searching through a predefined set of paths is also one. The test at present looks only at the following absolute paths (in that order):

/usr/bin/openssl
/usr/local/bin/openssl

On some systems, especially Cygwin-windows, etc..., the openssl may not be available in the above mentioned locations. This causes the test to skip some part of the execution.

This change lets the test consider the default openssl from the system path before referring the above mentioned locations.

The patch has been tested on all supported platforms.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8273646: Add openssl from path variable also in to Default System Openssl Path in OpensslArtifactFetcher

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5523

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

Using diff file

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

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Sep 15, 2021

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

Loading

@openjdk openjdk bot added the rfr label Sep 15, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 15, 2021

@thejasviv 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.

Loading

@openjdk openjdk bot added the security label Sep 15, 2021
@mlbridge
Copy link

@mlbridge mlbridge bot commented Sep 15, 2021

Webrevs

Loading

@wangweij
Copy link
Contributor

@wangweij wangweij commented Sep 15, 2021

My understanding is that the $PATH variable usually already contains /usr/bin and /usr/local/bin. If you switch to $PATH, maybe it's no more necessary to try out those 2 anymore?

Just curious, what is the full path of openssl on your Cygwin?

Loading

@thejasviv
Copy link
Member Author

@thejasviv thejasviv commented Sep 16, 2021

My understanding is that the $PATH variable usually already contains /usr/bin and /usr/local/bin. If you switch to $PATH, maybe it's no more necessary to try out those 2 anymore?

Just curious, what is the full path of openssl on your Cygwin?

On the machine I checked, it reads as follows:

PATH='C:\Cygwin\usr\local\bin;C:\Cygwin\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\cygwin\bin;C:\Users\jpgansible\AppData\Local\Microsoft\WindowsApps;%JAVA_HOME%\bin;C:\Cygwin\usr\local\bin' \

Loading

@thejasviv
Copy link
Member Author

@thejasviv thejasviv commented Sep 20, 2021

@wangweij, just a quick follow-up to make sure this change makes sense given the value of PATH variable on some of those machines (I mentioned it in the comment above). It appears it is true that openssl is indeed found inside /usr/local/bin directory, but on Cygwin-based systems, this actually translates to something like "C:\Cygwin\usr\local\bin" system path. Since we are explicitly passing "/usr/local/bin/openssl" to the process launcher, it fails to launch on such machines. We could have probably passed "C:\Cygwin...", but that would indicate some sort of prior knowledge towards where Cygwin is installed exactly. Hence, just an additional attempt with no absolute paths could succeed.

Loading

@wangweij
Copy link
Contributor

@wangweij wangweij commented Sep 20, 2021

OK, I understand why the previous 2 paths are not enough. The current change looks fine to me.

One small suggestion: since you're are using openssl from $PATH, I assume it's actually unnecessary to search in /usr/bin anymore. Maybe /usr/local/bin is still useful.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 20, 2021

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

8273646: Add openssl from path variable also in to Default System Openssl Path in OpensslArtifactFetcher

Reviewed-by: weijun

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

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.

As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@wangweij) but any other Committer may sponsor as well.

➡️ To flag this PR as ready for integration with the above commit message, type /integrate in a new comment. (Afterwards, your sponsor types /sponsor in a new comment to perform the integration).

Loading

@openjdk openjdk bot added the ready label Sep 20, 2021
@thejasviv
Copy link
Member Author

@thejasviv thejasviv commented Sep 21, 2021

Yes, I think your suggestion makes sense @wangweij. I will modify the patch today to remove /usr/bin/openssl, do a quick round of testing, and will re-upload.

Loading

@thejasviv
Copy link
Member Author

@thejasviv thejasviv commented Sep 21, 2021

/integrate

Loading

@openjdk openjdk bot added the sponsor label Sep 21, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Sep 21, 2021

@thejasviv
Your change (at version 3556e3e) is now ready to be sponsored by a Committer.

Loading

@akolarkunnu
Copy link
Contributor

@akolarkunnu akolarkunnu commented Sep 21, 2021

/sponsor

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 21, 2021

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

Your commit was automatically rebased without conflicts.

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Sep 21, 2021

@akolarkunnu @thejasviv Pushed as commit a5108a6.

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

Loading

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