-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
8303607: SunMSCAPI provider leaks memory and keys #12891
Conversation
👋 Welcome back macarte! A progress list of the required criteria for merging this PR into |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. Thanks.
@macarte 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:
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
Please see this link for an up-to-date comparison between the source branch of this pull request and the 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 |
/sponsor |
Mailing list message from Mat Carter on security-dev: Weijun, Would you be so kind as to review and sponsor this change for me given that you are familiar with my previous changes [1] (although this issue existed prior) Once this is in tip, I'll look to backport to 19, 17 and 11 Thanks in advance [1] https://bugs.openjdk.org/browse/JDK-8284850 Sent from Outlook From: security-dev <security-dev-retn at openjdk.org> on behalf of Mat Carter <macarte at openjdk.org> The message from this sender included one or more files ---------------------------------------------------------------------- [1] https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Flearn.microsoft.com%2Fen-us%2Fwindows%2Fwin32%2Fapi%2Fwincrypt%2Fnf-wincrypt-cryptacquirecertificateprivatekey&data=05%7C01%7Cmatthew.carter%40microsoft.com%7Ce26c0d2b15e8424b988f08db1e8ac459%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638137353598481138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=DkDIdugqfKkENfLVcInWsdaN8mQHZk%2FMEzMo8a%2FofzQ%3D&reserved=0 ------------- Commit messages: Changes: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.org%2Fjdk%2Fpull%2F12891%2Ffiles&data=05%7C01%7Cmatthew.carter%40microsoft.com%7Ce26c0d2b15e8424b988f08db1e8ac459%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638137353598481138%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=arWU6sUJYifADSnvxbxSbBhXixoV%2BfKQmERkfeleFWU%3D&reserved=0 PR: https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.openjdk.org%2Fjdk%2Fpull%2F12891&data=05%7C01%7Cmatthew.carter%40microsoft.com%7Ce26c0d2b15e8424b988f08db1e8ac459%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638137353598637370%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=SQm05Uv%2B8Dde%2FUGdyDV%2FJl4be2vyYVMjuA6c2aLyVXk%3D&reserved=0 |
Use the correct API for freeing key handles when directed to by the output of CryptAcquireCertificatePrivateKey [1].
Specifically when [out] pfCallerFreeProvOrNCryptKey is true we test [out] pdwKeySpec for the CERT_NCRYPT_KEY_SPEC flag. When flag bit is set we now call NCryptFreeObject, otherwise we continue to call CryptReleaseContext (as before)
[1] https://learn.microsoft.com/en-us/windows/win32/api/wincrypt/nf-wincrypt-cryptacquirecertificateprivatekey
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk pull/12891/head:pull/12891
$ git checkout pull/12891
Update a local copy of the PR:
$ git checkout pull/12891
$ git pull https://git.openjdk.org/jdk pull/12891/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 12891
View PR using the GUI difftool:
$ git pr show -t 12891
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/12891.diff