Fix OSSL_STORE_INFO leak#129446
Open
vcsjones wants to merge 2 commits into
Open
Conversation
Member
Author
|
Draft until #129435 is merged as that re-enables the test that will exercise this PR. |
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
bartonjs
approved these changes
Jun 15, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a resource leak in the OpenSSL 3 provider-based key-loading path by ensuring OSSL_STORE_INFO* is freed when a private key (OSSL_STORE_INFO_PKEY) entry is encountered.
Changes:
- Free
OSSL_STORE_INFO* infoafter extracting theEVP_PKEY*viaOSSL_STORE_INFO_get1_PKEY(info)inCryptoNative_LoadKeyFromProvider, preventing a leak on thebreakpath.
Show a summary per file
| File | Description |
|---|---|
| src/native/libs/System.Security.Cryptography.Native/pal_evp_pkey.c | Ensures OSSL_STORE_INFO is freed on the OSSL_STORE_INFO_PKEY early-exit path to prevent leaking store entries. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
Open
3 tasks
This was referenced Jun 16, 2026
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.
Nothing was freeing the
OSSL_STORE_INFOwhen the type wasOSSL_STORE_INFO_PKEY.