[release/9.0-staging] Fix shimmed implementation of TryGetHashAndReset to handle HMAC. #112015
+3
−14
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 #111929 to release/9.0-staging
/cc @vcsjones
Customer Impact
Reported by a customer in https://stackoverflow.com/questions/79392501/whats-so-dangerous-about-pkcs12loaderlimits-dangerousnolimits (tracked at #111926). Customers that use
X509CertificateLoader.LoadPkcs12
from the Microsoft.Bcl.Cryptography package will be unable to use it with the default limits if the platform selectsnetstandard2.0
assets, and will receive aCryptographicException
. This may occur for platforms such as UWP.This occurred because the validator incorrectly handled the name of HMAC algorithms.
Regression
Testing
The fix was manually verified by building the changes locally and observing that the exception no long occurred.
Risk
Low. The code that was identified as problematic was removed, as it was determined that checking the algorithm names in that location was not needed.