Skip to content

Conversation

vcsjones
Copy link
Member

Fixes #100983

When disposing of HashProviderCng, this would null out the _hHash handle. We have asserts elsewhere saying that the handle cannot be null. This may not be true during concurrent (mis-)use.

Instead of disposing and nulling it out, just dispose of it. The p/invoke will throw an ObjectDisposedException when marshaling the disposed handle which is the desired behavior.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones
See info in area-owners.md if you want to be subscribed.

@vcsjones vcsjones marked this pull request as draft April 12, 2024 20:23
@vcsjones vcsjones marked this pull request as ready for review April 12, 2024 20:34
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System.Security.Cryptography.Tests.FactorySha1Tests.HashAlgorithm_TransformBlockAndDispose_ConcurrentUseDoesNotCrashProcess fails
2 participants