Fix blob type in CopyWithPrivateKey for ML-DSA#129839
Open
PranavSenthilnathan wants to merge 1 commit into
Open
Fix blob type in CopyWithPrivateKey for ML-DSA#129839PranavSenthilnathan wants to merge 1 commit into
PranavSenthilnathan wants to merge 1 commit into
Conversation
Contributor
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an inconsistency in the Windows ML-DSA CNG cloning path: when an ML-DSA key has a seed, the code exports a seed blob from BCrypt but previously attempted to import it into CNG using the private key blob format. The change makes the import blob format match the exported blob type.
Changes:
- Update
CreateEphemeralCng()to prioritize the seed blob format when_hasSeedis true, aligningCngKeyBlobFormatwith thebcryptBlobTypeused for export.
This was referenced Jun 25, 2026
vcsjones
approved these changes
Jun 25, 2026
Member
|
We should backport this. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On recent Windows insider builds, some ML-DSA tests that used
CopyWithPrivateKeywere failing with the error below. We export a seed blob, but when we import that blob back into NCrypt we say it's a private key blob. Windows was somehow able to handle this before - maybe it just looked at the magic number number inside the blob instead of the blob type we passed into Import. The fix is just to use the correct blob type.