-
Notifications
You must be signed in to change notification settings - Fork 712
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
RFE: tools add --module-init arg for non-standard NSS softokn configDir #3049
Comments
This would not be standard compliant with 3.0, which means it would be an exception purely for the NSS module:
|
Recent NSS softokn fortunately supports also the environment variable Unfortunately, this is not much documented otherwise than in the code, but if you will need some help setting this up, please let me know: https://github.com/nss-dev/nss/blob/master/lib/softoken/pkcs11.c#L3344 I think it should be in version since NSS 3.95. |
Thank you! That works for me on Fedora 39. |
Would be great to document it somewhere. Every time I have to search for the code when somebody asks. If you have some code or test scripts you can share, or use in OpenSC tests or elsewhere, it would be great to have it at least as code example ... |
Works via p11-kit: pkcs11-tool -> p11-kit -> nss-softokn as p11-kit supports
The |
Problem Description
NSS softokn requires a non-standard argument : in C_Initialize CK_C_INITIALIZE_ARGS it wants
the pReserved field to point to a configuration string like
"configDir=<token_dir> ..."
https://github.com/servo/nss/blob/master/lib/softoken/sftkpars.c#L48
pkcs11-tool is using NULL for the pReserved field
Proposed Resolution
pkcs11-tool: add a command line arg
--module-init <string>
that will be used inC_Initialize
Steps to reproduce
Additional Notes
pkcs11-provider https://github.com/latchset/pkcs11-provider uses NSS softokn in integration tests, in order to do so it had to add the capability to pass
configDir= ...
to C_Initialize.https://github.com/latchset/pkcs11-provider/blob/main/docs/provider-pkcs11.7.md
https://github.com/latchset/pkcs11-provider/blob/main/src/interface.c#L309:
The text was updated successfully, but these errors were encountered: