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

Memoize some CngKey standard properties #99053

Merged
merged 4 commits into from
Mar 6, 2024
Merged

Conversation

vcsjones
Copy link
Member

This memoizes some CngKey properties similar to what we did for KeySize in #89599 for performance. Accessing CNG key properties by Win32 have non-trivial performance characteristics since it results in an LRPC call. These properties are set during key creation time and cannot be changed after-the-fact, so storing them is reasonable.

Closes #89821

@vcsjones vcsjones added this to the 9.0.0 milestone Feb 28, 2024
@vcsjones vcsjones requested a review from bartonjs February 28, 2024 16:11
@ghost
Copy link

ghost commented Feb 28, 2024

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

Issue Details

This memoizes some CngKey properties similar to what we did for KeySize in #89599 for performance. Accessing CNG key properties by Win32 have non-trivial performance characteristics since it results in an LRPC call. These properties are set during key creation time and cannot be changed after-the-fact, so storing them is reasonable.

Closes #89821

Author: vcsjones
Assignees: -
Labels:

area-System.Security

Milestone: 9.0.0

@vcsjones vcsjones merged commit 5f52977 into dotnet:main Mar 6, 2024
111 checks passed
@vcsjones vcsjones deleted the cng-memoize branch March 6, 2024 21:12
@github-actions github-actions bot locked and limited conversation to collaborators Apr 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider memoizing more CNG properties on CngKey that can't change after the key is finalized
3 participants