Skip to content

Conversation

@vcsjones
Copy link
Member

@vcsjones vcsjones commented Jun 2, 2022

Finding certificates by thumbprint is a pretty common scenario, so we can eliminate a 20-byte allocation per-certificate-searched when searching by thumbprint.

GetCertHash returns a defensive copy of the thumbprint. Instead, we can get the thumbprint in a stack buffer, and do an upfront check on the size of the to-be-found thumbprint.

@ghost ghost added the area-System.Security label Jun 2, 2022
@ghost ghost assigned vcsjones Jun 2, 2022
@ghost
Copy link

ghost commented Jun 2, 2022

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

Issue Details

Finding certificates by thumbprint is a pretty common scenario, so we can eliminate a 20-byte allocation per-certificate-searched when searching by thumbprint.

GetCertHash returns a defensive copy of the thumbprint. Instead, we can get the thumbprint in a stack buffer, and do an upfront check on the size of the to-be-found thumbprint.

Author: vcsjones
Assignees: vcsjones
Labels:

area-System.Security

Milestone: -

@vcsjones vcsjones merged commit fe2c1ed into dotnet:main Jun 2, 2022
@vcsjones vcsjones deleted the find-thumbprint-alloc branch June 2, 2022 22:27
@ghost ghost locked as resolved and limited conversation to collaborators Jul 3, 2022
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.

2 participants