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

[.NET 5 RC2 Regression] HashAlgorithm.ComputeHash is unsupported on 'browser' #26879

Closed
SommerEngineering opened this issue Oct 14, 2020 · 2 comments

Comments

@SommerEngineering
Copy link

Describe the bug

In .NET 5 RC1 the hash algorithms were not included, cf. dotnet/runtime#42625. This has been fixed (dotnet/runtime#42267): In .NET 5 RC2 we can use hash algorithms again, e.g. to hash the user passwords on the client side. However, the compiler issues a warning, which is a false positive kind of error:

Login.razor.cs(140,28): warning CA1416: 'HashAlgorithm.ComputeHash(byte[])' is unsupported on 'browser'

I assume that this is an error in the "Browser platform compatibility tooling".

To Reproduce

Use the following code in Blazor:

using SHA512 sha512 = new SHA512Managed();
var data = sha512.ComputeHash(Encoding.UTF8.GetBytes("password"));

Then, dotnet build will show the warning but the code works fine, though.

Further technical details

.NET SDK (reflecting any global.json):
Version: 5.0.100-rc.2.20479.15
Commit: da7dfa8840

Runtime Environment:
OS Name: Windows
OS Version: 10.0.17763
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\5.0.100-rc.2.20479.15\

Host (useful for support):
Version: 5.0.0-rc.2.20475.5
Commit: c5a3f49c88

.NET SDKs installed:
3.1.202 [C:\Program Files\dotnet\sdk]
3.1.402 [C:\Program Files\dotnet\sdk]
5.0.100-rc.2.20479.15 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
Microsoft.AspNetCore.All 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.0-rc.2.20475.17 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.18 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.0-rc.2.20475.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.0-rc.2.20475.6 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

@campersau
Copy link
Contributor

I think that this is already worked on here dotnet/runtime#43387
See also related issue dotnet/runtime#43380

@SommerEngineering
Copy link
Author

Thanks @campersau for letting me know 🙂 I close the issue.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants