-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add automatic support for p11-kit #260
Merged
Merged
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
2723a8f
Add automatic support for p11-kit
maraino 237a370
Mock findP11KitProxy on New test
maraino 1e80f66
Rely on dlopen to locate p11-kit-proxy.so
maraino bc3ba29
Fix missing-module test
maraino a23378d
Add p11-kit-proxy.dll for windows and validate uri
maraino f840799
Add some docs on the pkcs11 kms
maraino 8d82ef2
Add tests and examples with id with %
maraino 572bfb7
Apply suggestions from code review
maraino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is in the wrong place, isn't it? It'll only happen if a URI is given, but there's an alternative code flow where it's all in the config? That should benefit from the default, too.
There's already a check for
config.Path == ""
a few lines further down, with an error return which is no longer telling the truth because it says that 'module-path is required'.Also... what's wrong with
pkcs11:manufacturer=piv_II;id=%01
which I usually use as my examples in documentation? Why are only token/serial/slot-id accepted, and not model/manufacturer?(And why is this something you even need to do for yourself; surely "match token against the attributes in a URI" is a generic thing that ought to be somewhere much further down the stack than your code; in ThalesIgnite/crypto11 or miekg/pkcs11. Ideally you just want to call a function like the matchSlots() I wrote here, and in your case as discussed, you want to just bail if
len(slots) != 1
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In particular, these two:
.. especially the former. I don't want to live in a world where we have to tell users to explicitly pass a
module-path
.All those examples for how to use different HSMs differ mostly in the
module-path
, which shouldn't be needed anyway.The packaging of the PKCS#11 provider module itself should come with a p11-kit .module file, the token should automatically appear in the output of things like
p11-kit list-tokens
orp11tool --list-tokens
(and thus also in GUIs when you're selecting a client cert for 802.1x or VPN auth, etc.)The common case is that user should just be able to select a token from the list, e.g.
pkcs11:manufacturer=piv_II
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PKCS#11 cannot be configured without a URI, currently you will get the following error:
We can make it more explicit and actually fail if URI == "".
Nothing, but https://github.com/ThalesIgnite/crypto11, which is the one we use on top of github.com/miekg/pkcs11 doesn't support it, see this code.
Regarding the documentation, some of it is managed by a different team, and we haven't integrated this yet, so it will have to wait a bit. But I can change
step-kms-plugin
README and help once this is integrated.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've fixed some of this in a23378d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I've added that specific reference to ThalesGroup/crypto11#104