Skip to content
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

Cache URI/PIN on objects when PIN is specified in URI #297

Open
simo5 opened this issue Oct 23, 2023 · 2 comments
Open

Cache URI/PIN on objects when PIN is specified in URI #297

simo5 opened this issue Oct 23, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@simo5
Copy link
Member

simo5 commented Oct 23, 2023

pkcs11 uris are used to search for objects.
A pin (or pin file) can be used as a pkcs11 URI parameter, in which case interactive pin requests are not needed.
Objects found using a URI provided PIN may later used in functions that require authentication (for example when CKA_ALWAYS_AUTHENTICATE is set on a key.
Caching the PIN on the key object would allow to easily provide the PIN to the Context Specific C_Login operation in those cases.

@simo5 simo5 added the enhancement New feature or request label Oct 23, 2023
@simo5
Copy link
Member Author

simo5 commented Oct 23, 2023

Related to #42

@sahanaprasad07 sahanaprasad07 self-assigned this Oct 23, 2023
@Jakuje
Copy link
Contributor

Jakuje commented Nov 13, 2023

I have related issue that the pincache test is actually not testing caching of the PIN from UI prompt, but reads PIN from default openssl.cnf which contains the PIN. Trying with the openssl.cnf.nopin config, it correctly asks for PIN, but then fails in the child:

$ PRIURI="$ECPRI3URI" OPENSSL_CONF=tmp.softhsm/openssl.cnf.nopin ./pincache
Prompt: "Enter pass phrase for PKCS#11 Token (Slot 771260799 - SoftHSM slot ID 0x2df8817f):"
Returning: 12345678
Failed to EVP_DigestSignUpdate
405C49F35D7F0000:error:40800060:pkcs11:p11prov_sig_operate_init:The specified key handle is not valid:signature.c:791:Provided key has invalid handle

I am looking into this as part of #298 so I might be able to provide some fix in if I will notice something obvious.

@sahanaprasad07 sahanaprasad07 removed their assignment Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants