-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
(Should we) Provide implementations for {RSA,DSA,ECDsa}.HashData(?) #66228
Comments
Tagging subscribers to this area: @dotnet/area-system-security, @vcsjones Issue DetailsAll of our derived types for these algorithms now call the exact same helpers (except maybe DSACryptoServiceProvider, which fails if you ask for something other than SHA-1, because of FIPS 186-2 limitations). Perhaps instead of re-implementing these methods identically 14 times ({CNG,CSP,OpenSSL,Android,Apple} * {RSA,DSA,ECDSA} - DSACSP)) we should define them just the 3 times.
|
Seems reasonable. I can throw up a PR to see what it'd look like. |
Really this is a bit "I have no idea why we made these methods as virtual+throw" (except where they're, maybe, abstract). Possibly it was just that we didn't have access to the dispatchers we wanted to use on .NET Framework (System.dll vs System.Core.dll). Unless someone can remember a good reason why they're virtual+throw then virtual+work seems good to me. @nguerrera any chance you have the answer in the back of your head? I feel like some of these popped up in 4.6.0 😄 |
Well, runtime/src/libraries/System.Security.Cryptography/src/System/Security/Cryptography/RSA.cs Line 100 in 3ae8739
We would want to continue to override Or, we stop calling the virtual and take it as a breaking change, if we want. |
I'm afraid any details I had about this have long escaped my memory. 😂 |
I was going to suggest something like using reflection to ask if the current type was defined in the same assembly as Though, if the JIT does do a good job there (or has a similar pattern for it) then it would let us delete more trivia. So... less a suggestion than an area to maybe investigate. |
Ohhh I misunderstood. It can’t be a |
I think you can implement an internal interface |
Since #66349 was merged, closing this. |
All of our derived types for these algorithms now call the exact same helpers (except maybe DSACryptoServiceProvider, which fails if you ask for something other than SHA-1, because of FIPS 186-2 limitations).
Perhaps instead of re-implementing these methods identically 14 times ({CNG,CSP,OpenSSL,Android,Apple} * {RSA,DSA,ECDSA} - DSACSP)) we should define them just the 3 times.
The text was updated successfully, but these errors were encountered: