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

Missing HMAC breaking change #21019

Closed
ealsur opened this issue Oct 9, 2020 · 6 comments
Closed

Missing HMAC breaking change #21019

ealsur opened this issue Oct 9, 2020 · 6 comments
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release

Comments

@ealsur
Copy link

ealsur commented Oct 9, 2020

Please see this thread: Azure/azure-cosmos-dotnet-v3#1865 (comment)

HMAC is also a breaking change that should be listed in the Cryptography section.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@gewarren gewarren added breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release and removed ⌚ Not Triaged Not triaged labels Oct 9, 2020
@gewarren
Copy link
Contributor

gewarren commented Oct 9, 2020

Related to #20143. But wouldn't HMAC be covered by the statement in "Affected APIs":

All System.Security.Cryptography APIs except the following:

System.Security.Cryptography.RandomNumberGenerator
System.Security.Cryptography.IncrementalHash
System.Security.Cryptography.SHA1
System.Security.Cryptography.SHA256
System.Security.Cryptography.SHA384
System.Security.Cryptography.SHA512
System.Security.Cryptography.SHA1Managed
System.Security.Cryptography.SHA256Managed
System.Security.Cryptography.SHA384Managed
System.Security.Cryptography.SHA512Managed

Would it be better to explicitly list each affected API?

@ealsur
Copy link
Author

ealsur commented Oct 9, 2020

In the case our users reported, it was System.Security.Cryptography.HMACSHA256.

From that thread:

The SHA* hash algorithms were added back in RC2 as a special exception to policy. That exception did not extend code dealing with secrets so HMAC computations were not included. Given that, there isn't anything we can do on the runtime side either. I'm not familiar enough to be sure but if there is a way to supply a custom asynchronous authentication provider you might be able to use the Blazor interop code to call into the browser and use crypto.sign to generate your authentication code. Unfortunately it won't be possible to use System.Security to do it in net5.0.

@gewarren
Copy link
Contributor

gewarren commented Oct 9, 2020

Okay, I guess I'm not sure what is missing from the doc then, unless you think it should explicitly list each affected API instead of the APIs that aren't affected.

@GrabYourPitchforks
Copy link
Member

I agree with @gewarren's assessment. The docs seem clear on this: if it's in System.Security.Cryptography, it'll throw PNSE at runtime unless it's on that list of things that have been special-cased.

@GrabYourPitchforks
Copy link
Member

Here's the error text that's presented to the user as part of the PNSE:

System.Security.Cryptography.Algorithms is not supported on this platform.

Maybe this error text needs to be more descriptive? Maybe it needs to include a link to the breaking change notification?

@ealsur
Copy link
Author

ealsur commented Oct 12, 2020

@GrabYourPitchforks I see now what you mean, I believe that I got the wrong meaning of the Affected APIs section, totally missed the "except" in the text and thought the list was of the APIs that were broken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-change Indicates a .NET Core breaking change 🏁 Release: .NET 5 Work items for the .NET 5 release
Projects
None yet
Development

No branches or pull requests

5 participants