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

8258915: Temporary buffer cleanup #2070

Closed
wants to merge 12 commits into from
Closed

Conversation

@wangweij
Copy link
Contributor

@wangweij wangweij commented Jan 13, 2021

Clean up temporary byte array, char array, and keyspec around keys and passwords.

No new regression test.


Progress

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

Issue

Reviewers

Reviewing

Using git

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

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

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 2070

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

Using diff file

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

8258915: More temporary buffer cleanup
@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Jan 13, 2021

👋 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.

Loading

@openjdk openjdk bot added the rfr label Jan 13, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 13, 2021

@wangweij The following labels will be automatically applied to this pull request:

  • core-libs
  • security

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Jan 13, 2021

/label remove core-libs

Loading

@openjdk openjdk bot removed the core-libs label Jan 13, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Jan 13, 2021

@wangweij
The core-libs label was successfully removed.

Loading

@mlbridge
Copy link

@mlbridge mlbridge bot commented Jan 13, 2021

Loading

@rhalade
Copy link
Member

@rhalade rhalade commented Jan 13, 2021

please add noreg label to the JBS bug.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Jan 14, 2021

please add noreg label to the JBS bug.

Added. Thanks.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Jan 21, 2021

Just pushed a new commit. First I merged into the RSA PKCS #1 code change from @valeriepeng, and then reapplied the cleanup to RSAKeyFactory. Most new code change is inside RSAPrivateCrtKeyImpl. I also updated DerValue and DerOutpuStream a little to avoid unnecessary array copying.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Jan 22, 2021

New commit. However, I was writing test to detect leak in RSAPrivateKeySpec conversion and add more key->spec->key for other algorithms and find more leaks. Will fix in another commit.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Jan 22, 2021

Another new commit. Last time I only fixed KeySpec on PKCS8 format. This time it's for an algorithm's own spec.

Loading

only in patch2:
unchanged:
@valeriepeng
Copy link

@valeriepeng valeriepeng commented Feb 4, 2021

New commit for key generations.

How about the Tls*Generator classes in SunJCE provider? Looks like they need to be handled as well.

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Feb 4, 2021

New commit for key generations.

How about the Tls*Generator classes in SunJCE provider? Looks like they need to be handled as well.

I'll take a look. I thought the secrets going in and out of them are ephemeral.

Loading

Copy link

@valeriepeng valeriepeng left a comment

Other files look fine. Thanks~

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Feb 19, 2021

Add one more clean. Adjusting macKeyLen and ivLen in TlsKeyMaterialParameterSpec exposed another leak.

Loading

Copy link

@valeriepeng valeriepeng left a comment

Changes look good. Thanks~

Loading

@openjdk
Copy link

@openjdk openjdk bot commented Feb 22, 2021

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

8258915: Temporary buffer cleanup

Reviewed-by: 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 1 new commit pushed to the master branch:

  • 31d8a19: 8265105: gc/arguments/TestSelectDefaultGC.java fails when compiler1 is disabled

Please see this link for an up-to-date comparison between the source branch of this pull request and 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.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

Loading

@openjdk openjdk bot added the ready label Feb 22, 2021
@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Feb 22, 2021

Changes look good. Thanks~

Thanks a lot for your patience and precious feedback.

Loading

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented Apr 21, 2021

@wangweij This pull request has been inactive for more than 4 weeks and will be automatically closed if another 4 weeks passes without any activity. To avoid this, simply add a new comment to the pull request. Feel free to ask for assistance if you need help with progressing this pull request towards integration!

Loading

@wangweij
Copy link
Contributor Author

@wangweij wangweij commented Apr 22, 2021

/integrate

Loading

@openjdk openjdk bot closed this Apr 22, 2021
@openjdk openjdk bot added integrated and removed ready rfr labels Apr 22, 2021
@openjdk
Copy link

@openjdk openjdk bot commented Apr 22, 2021

@wangweij Since your change was applied there has been 1 commit pushed to the master branch:

  • 31d8a19: 8265105: gc/arguments/TestSelectDefaultGC.java fails when compiler1 is disabled

Your commit was automatically rebased without conflicts.

Pushed as commit f834557.

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

Loading

@wangweij wangweij deleted the 8258915 branch Apr 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants