8354469: Keytool exposes the password in plain text when command is piped using | grep#3233
Draft
fitzsim wants to merge 7 commits into
Draft
8354469: Keytool exposes the password in plain text when command is piped using | grep#3233fitzsim wants to merge 7 commits into
fitzsim wants to merge 7 commits into
Conversation
Backport-of: 91417890a24450d7cb23d188df4f631304d41ed6
…iped using | grep Backport-of: a7a3a660e33fabc025ebe887f5605741be9ca8c3
This gives sun.security.util.Password access to the password console's charset field.
Remove the "Copy" hyperlinks and instead just instruct the user to copy each command manually. Add spaces where necessary.
|
👋 Welcome back fitzsim! A progress list of the required criteria for merging this PR into |
|
❗ This change is not yet ready to be integrated. |
|
This backport pull request has now been updated with issue from the original commit. |
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.
This pull request backports:
8354469: Keytool exposes the password in plain text when command is piped using | grepIt depends on pull request #3232 which backports:
8366261: Provide utility methods for sun.security.util.PasswordStarting from the backport of 8354469 to 17, I made the following adjustments:
Console.java:
Password.java:
Adjust copyright year
17 renamed "misc" to "access" in "import jdk.internal.access.SharedSecrets;" as part of:
8211122: Reduce the number of internal classes made accessible to jdk.unsupported
so skip that.
17 then removed "import jdk.internal.access.SharedSecrets;" and called "System.console().charset()" directly instead of via SharedSecrets as part of:
8264208: Console charset API
which was never backported, so skip that and continue using SharedSecrets.
17 re-added "import jdk.internal.access.SharedSecrets;" as part of:
8354469: Keytool exposes the password in plain text when command is piped using | grep
to be able to call passwordConsole and readPasswordNoNewLine, so again, I just keep "import jdk.internal.misc.SharedSecrets;" constant in 11
11 does not have Console.charset, so modify the JavaIOAccess interface to accept a Console argument which returns the value of the passed console's private charset (
cs) field.SetInPassword.java:
EchoPassword.java:
Change to use traditional multiline-string syntax since 11 does not support
"""multiline strings; update message whitespaceRemove support for the convenience "Copy Command" hyperlinks since hyperlinkListener support is not available in 11; update message accordingly
I did briefly try to maintain these links and status label, but it would have required first backporting:
8367348: Enhance PassFailJFrame to support links in HTMLwhich did not apply cleanly to 11, so I decided to simplify the test instead.
Remove the now-unused status label
Usages.java:
that file does not exist in 11
The new
SetInPassword.javatest passes and with the modifications herein, theEchoPassword.javaalso passes.Progress
Issue
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk11u-dev.git pull/3233/head:pull/3233$ git checkout pull/3233Update a local copy of the PR:
$ git checkout pull/3233$ git pull https://git.openjdk.org/jdk11u-dev.git pull/3233/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 3233View PR using the GUI difftool:
$ git pr show -t 3233Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk11u-dev/pull/3233.diff