Remove managed implementation from SP800-108 on Windows#122816
Merged
stephentoub merged 2 commits intodotnet:mainfrom Jan 3, 2026
Merged
Remove managed implementation from SP800-108 on Windows#122816stephentoub merged 2 commits intodotnet:mainfrom
stephentoub merged 2 commits intodotnet:mainfrom
Conversation
…used for Windows 7.
Contributor
|
Tagging subscribers to this area: @dotnet/area-system-security, @bartonjs, @vcsjones |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes Windows 7 support from SP800-108 HMAC Counter KDF by eliminating the fallback to the managed implementation. Windows 8 and later versions have native CNG support for this algorithm, making the managed implementation unnecessary for supported Windows versions.
- Removed Windows version detection logic (
IsWindowsVersionAtLeast(6, 2)) - Simplified implementation to always use the CNG-based implementation on Windows
- Removed managed implementation file references from the Windows-specific build configuration
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| SP800108HmacCounterKdf.Windows.cs | Removed Windows version checks and simplified all methods to directly call the CNG implementation |
| System.Security.Cryptography.csproj | Removed two references to SP800108HmacCounterKdfImplementationManaged.cs from the Windows-specific ItemGroup |
stephentoub
approved these changes
Jan 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
It was only used for Windows 7.
While we are doing some cleanup, let's get rid of a hand-rolled one-shot implementation we don't need anymore. This will be more efficient for NativeAOT.
Contributes to #71075.