Correctly set the machine store flag when requested#802
Merged
Conversation
areed
commented
Jul 11, 2025
|
|
||
| // Key Storage Flags | ||
| NCRYPT_MACHINE_KEY_FLAG = 0x00000001 | ||
| NCRYPT_MACHINE_KEY_FLAG = 0x00000020 |
Contributor
Author
maraino
requested changes
Jul 21, 2025
kms/capi/capi.go
Outdated
Comment on lines
+50
to
+52
| SoftwareProvider = "Microsoft Software Key Storage Provider" | ||
| SmartCardProvider = "Microsoft Smart Card Key Storage Provider" | ||
| PlatformProvider = "Microsoft Platform Crypto Provider" |
Contributor
There was a problem hiding this comment.
ncrypt_windows.go provides the same constants with a different name, perhaps we want to use those instead of creating new ones. We should also use a constant on New() to set the default provider.
18cbf69 to
ab01b7b
Compare
Fix the NCRYPT_MACHINE_KEY_FLAG constant and use it in calls for key operations when the machine store is specified in the uri.
ab01b7b to
2fe35c1
Compare
maraino
approved these changes
Aug 6, 2025
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.
Fix the NCRYPT_MACHINE_KEY_FLAG constant and use it in calls for key operations when the machine store is specified in the uri. Validate the store arg is compatible with the provider.
Pain or issue this feature alleviates:
Why is this important to the project (if not answered above):
Creating a key in the machine store fails. Getting or deleting a key from the machine store silently gets or deletes the key of the same name in the user store.
In what environments or workflows is this feature supported?
Windows
💔Thank you!