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

Call SHA1.HashData static helper instead of instantiating SHA1CSP #3318

Merged
merged 1 commit into from
Jan 7, 2021

Conversation

GrabYourPitchforks
Copy link
Member

We're trying to minimize usage of the *CryptoServiceProvider and *Managed types through our code bases so that we can eventually write analyzers to recommend moving off of them. See dotnet/runtime#40169 for some related discussion w.r.t. RNGCryptoServiceProvider.

This PR changes the call site to use the static one-shot helper method so that you don't need to instantiate a hasher object. The HashData static method uses the best available implementation for the current OS.

@GrabYourPitchforks GrabYourPitchforks requested a review from a team as a code owner August 8, 2020 01:27
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Aug 8, 2020
@ghost ghost requested review from fabiant3, ryalanms and SamBent August 8, 2020 01:27
@reflectronic
Copy link

reflectronic commented Aug 26, 2020

This code is actually copied from C#/WinRT. Once the support for WinRT interop flows into the SDK in a way that WPF can consume, this file is supposed to be removed. You may want to submit this fix to the C#/WinRT repo instead.

@ryalanms
Copy link
Member

ryalanms commented Jan 7, 2021

Thanks, @GrabYourPitchforks.

@ryalanms ryalanms merged commit 03c2dfd into dotnet:master Jan 7, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Apr 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants