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

@openjdk openjdk bot added the rfr Pull request is ready for review label Jan 13, 2021
@openjdk
Copy link

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.

@openjdk openjdk bot added security security-dev@openjdk.org core-libs core-libs-dev@openjdk.org labels Jan 13, 2021
@wangweij
Copy link
Contributor Author

/label remove core-libs

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

openjdk bot commented Jan 13, 2021

@wangweij
The core-libs label was successfully removed.

@mlbridge
Copy link

mlbridge bot commented Jan 13, 2021

@rhalade
Copy link
Member

rhalade commented Jan 13, 2021

please add noreg label to the JBS bug.

@wangweij
Copy link
Contributor Author

please add noreg label to the JBS bug.

Added. Thanks.

@wangweij
Copy link
Contributor Author

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.

@wangweij
Copy link
Contributor Author

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.

@wangweij
Copy link
Contributor Author

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

only in patch2:
unchanged:
@valeriepeng
Copy link
Contributor

New commit for key generations.

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

@wangweij
Copy link
Contributor Author

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.

Copy link
Contributor

@valeriepeng valeriepeng left a comment

Choose a reason for hiding this comment

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

Other files look fine. Thanks~

@wangweij
Copy link
Contributor Author

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

Copy link
Contributor

@valeriepeng valeriepeng left a comment

Choose a reason for hiding this comment

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

Changes look good. Thanks~

@openjdk
Copy link

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.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Feb 22, 2021
@wangweij
Copy link
Contributor Author

Changes look good. Thanks~

Thanks a lot for your patience and precious feedback.

@bridgekeeper
Copy link

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!

@wangweij
Copy link
Contributor Author

/integrate

@openjdk openjdk bot closed this Apr 22, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Apr 22, 2021
@openjdk
Copy link

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.

@wangweij wangweij deleted the 8258915 branch April 22, 2021 18:14
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.

3 participants