-
Notifications
You must be signed in to change notification settings - Fork 10
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
supporting CFSSL #151
Comments
Is your NetHSM provisioned and operational? |
Yes, both from REST and PKCS all's good status operational, and also used openssl engine with pkcs11 to generate the root cert and imported it into the HSM. The patched CFSSL with PKCS11# support is available here https://github.com/tenda-dev/cfssl Debug Log....... root | 2023/12/04 18:21:27 [INFO] PKCS11 PIN for token LocalHSM is not specified in config; please enter it on PIN pad if available I am initialising the pkcs11 session like this, perhaps therein lies the issue....
|
I do not fully understand your setup, so let me describe it in my own words: I assume the mentioned code
is from https://github.com/tenda-dev/cfssl/blob/4513b7df7b567b487ba1fd1f59d48b91b1798d7a/multiroot/config/config.go#L292?
Did you made any changes between your two posts? The error messages differ:
Second Post:
Could you provide a step-by-step manual to reproduce the mentioned behavior? My first impression is that some PKCS#11 parameters are wrong. So in the best case only the mentioned config has to be adjusted. |
I was able to debug between the first and second post, found there was a wrong nethsm url, which I corrected. and using the roots.conf as below p11nethsm.conf is as below enable_set_attribute_value: false
I started CFSSL with the multirootca cmd I end up with the error I have created the pub/priv (CA-ROOT.pem) key pair on the nethsm using the REST API. I suspect the issue lies in how the CFSSL PKCS#11 driver is calling/sending instructions to the nethsm and without a debugging/pkcs#11spy or something to see how it is currently implemented i'm chasing a black cat in the dark. Perhaps you can help.to resolve. |
With this mod applied, one can use [PKCS11] (https://github.com/ibpl/cfssl/tree/master-IB%231094763) token in multirootca for certs signing (tested succesfully with Nitrokey HSM 2; should work with other compatible HSM tokens too). Requires importing https://github.com/letsencrypt/pkcs11key
Example config below works with Nitrokey-HSM
[ default ]
private = pkcs11://notused
module = /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
token_label = UserPIN (myhsm)
pin = 123456
config = /etc/cfssl/server.json
certificate = /etc/cfssl/issuer.crt
Note: issuer.crt must contain cert issued for signing key in HSM.
However when using it on NetHSM like below, running into [FATAL] pkcs11key: pkcs11key: opening session: pkcs11: 0x6: CKR_FUNCTION_FAILED. Can you replicate the issue and assist with debugging.
[ default ]
private = pkcs11://notused
module = /usr/lib/nitrokey/libnethsm_pkcs11.so
token_label = pkcs11:object=MYKEY1;type=public
pin = ""
config = /etc/cfssl/server.json
certificate = /etc/cfssl/issuer.crt
The text was updated successfully, but these errors were encountered: