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

8286069: keytool prints out wrong key algorithm for -importpass command #8520

Closed
wants to merge 2 commits into from

Conversation

wangweij
Copy link
Contributor

@wangweij wangweij commented May 3, 2022

Since keytool -importpass always uses KeyFactory.getInstance("PBE") to generate the secret key, and "PBE" is an alias of "PBEwithMD5andDES" inside the SunJCE security provider, its getAlgorithm is always PBEwithMD5andDES.

This code change modifies it to "PBE".

Note that I haven't chosen the -keyalg option value here because it is actually the algorithm used to protect the PBE secret key entry. It's a cipher algorithm instead of a key algorithm.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed (1 reviews required, with at least 1 reviewer)

Issue

  • JDK-8286069: keytool prints out wrong key algorithm for -importpass command

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 8520

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

Using diff file

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

Sorry, something went wrong.

@bridgekeeper
Copy link

bridgekeeper bot commented May 3, 2022

👋 Welcome back weijun! 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 the rfr Pull request is ready for review label May 3, 2022
@openjdk
Copy link

openjdk bot commented May 3, 2022

@wangweij 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 May 3, 2022
@mlbridge
Copy link

mlbridge bot commented May 3, 2022

Webrevs

Copy link
Contributor

@haimaychao haimaychao left a comment

Choose a reason for hiding this comment

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

LGTM.

.shouldHaveExitValue(0)
.shouldContain("Generated PBE secret key");

// The aid of a protected entry (at 110c010c01010c0 inside p12) is:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use "algorithm id" instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem.

@openjdk
Copy link

openjdk bot commented May 4, 2022

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

8286069: keytool prints out wrong key algorithm for -importpass command

Reviewed-by: hchao, valeriep

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

  • efcd3d3: 8286088: add comment to InstallAsyncExceptionHandshake destructor
  • f82dd76: 8285885: Replay compilation fails with assert(is_valid()) failed: check invoke
  • be67acd: 8285832: runtime/Thread/TooSmallStackSize.java failed "assert(k->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation"
  • 39e50c2: 8273506: java Robot API did the 'm' keypress and caused /awt/event/KeyEvent/KeyCharTest/KeyCharTest.html is timing out on macOS 12
  • 3cbf769: 8285977: Add links to IEEE 754 specification
  • 4434c7d: 8265360: several compiler/whitebox tests fail with "private compiler.whitebox.SimpleTestCaseHelper(int) must be compiled"
  • ffca23a: 8284490: Remove finalizer method in java.security.jgss
  • 0f62cb6: 8285921: serviceability/dcmd/jvmti/AttachFailed/AttachReturnError.java fails on Alpine
  • 6fcd322: 8279622: C2: miscompilation of map pattern as a vector reduction
  • af1ee1c: 8283684: IGV: speed up filter application
  • ... and 11 more: https://git.openjdk.java.net/jdk/compare/cfcba1fccc8e3e6a68e1cb1826b70e076d5d83c4...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 May 4, 2022

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@wangweij
Copy link
Contributor Author

wangweij commented May 4, 2022

/integrate

@openjdk
Copy link

openjdk bot commented May 4, 2022

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

  • efcd3d3: 8286088: add comment to InstallAsyncExceptionHandshake destructor
  • f82dd76: 8285885: Replay compilation fails with assert(is_valid()) failed: check invoke
  • be67acd: 8285832: runtime/Thread/TooSmallStackSize.java failed "assert(k->is_initialized()) failed: need to increase java_thread_min_stack_allowed calculation"
  • 39e50c2: 8273506: java Robot API did the 'm' keypress and caused /awt/event/KeyEvent/KeyCharTest/KeyCharTest.html is timing out on macOS 12
  • 3cbf769: 8285977: Add links to IEEE 754 specification
  • 4434c7d: 8265360: several compiler/whitebox tests fail with "private compiler.whitebox.SimpleTestCaseHelper(int) must be compiled"
  • ffca23a: 8284490: Remove finalizer method in java.security.jgss
  • 0f62cb6: 8285921: serviceability/dcmd/jvmti/AttachFailed/AttachReturnError.java fails on Alpine
  • 6fcd322: 8279622: C2: miscompilation of map pattern as a vector reduction
  • af1ee1c: 8283684: IGV: speed up filter application
  • ... and 11 more: https://git.openjdk.java.net/jdk/compare/cfcba1fccc8e3e6a68e1cb1826b70e076d5d83c4...master

Your commit was automatically rebased without conflicts.

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

openjdk bot commented May 4, 2022

@wangweij Pushed as commit 075ce8a.

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

@wangweij wangweij deleted the 8286069 branch May 30, 2022 16:45
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
Development

Successfully merging this pull request may close these issues.

None yet

3 participants