Repository navigation
[release/5.0-rc2] WASM: Add SHA* hash functions - #41761
Merged
Merged
Conversation
This ports the managed SHA* hash functions from https://github.com/microsoft/referencesource so we can use them on Browser/WASM where we don't have OpenSSL. Enables the System.Security.Cryptography.Algorithms tests for these classes: `Tests run: 271, Errors: 0, Failures: 0, Skipped: 1. Time: 11.028473s` Resolves #40076
GrabYourPitchforks
approved these changes
Sep 2, 2020
Contributor
|
What tests do we have that the hashing functions produce the correct result? If I understand right, until now we were relying on OpenSSL/Windows and testing their implementation's correctness presumably wasn't a goal so we don't have tests for it? |
Member
|
@danmosemsft we do have tests that verify the correct SHA value is produced: |
Member
|
Approved for RC2. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Backport of #40486 to release/5.0-rc2
Fixes #40076
/cc @akoeplinger
Customer Impact
Unblocks customer apps that used SHA hashing functions (like Roslyn) in Blazor WASM apps. Those worked in the 3.2 Blazor release since it was based on Mono's BCL which had managed implementations for the algorithms. Updating to the 5.0 previews with .NET BCL caused the apps to fail with
PlatformNotSupportedExceptionsince we don't support OpenSSL on browser.Examples: #40080 , #39893 , dotnet/aspnetcore#24362 and #39756.
Adding the managed SHA* implementations is a temporary step until we can replace them with interop to the SubtleCrypto API the browser provides, #40074 tracks that.
Testing
Tested in CI and manually.
Risk
Low, just ports managed implementations for SHA algorithms from referencesource.