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

Avoid prompting for pin on pinpad without the implicit call to C_Login() #2933

Open
Jakuje opened this issue Nov 13, 2023 · 1 comment
Open

Comments

@Jakuje
Copy link
Member

Jakuje commented Nov 13, 2023

Problem Description

Initially brought up by @larssilven in #2916 (comment) the way how sc_pkcs15init_verify_secret() is implemented, it can result in prompts for PIN in totally unexpected places for a user, without any prompt by the application in case the pinpad is enabled:

r = sc_pkcs15_verify_pin(p15card, pin_obj, use_pinpad || pinsize == 0 ? NULL : pinbuf, use_pinpad ? 0 : pinsize);

Proposed Resolution

Given for how long this code is in, I would propose to address this after 0.24.0 will be out

Steps to reproduce

  • Have reader with pinpad, make sure the enable_pinpad = true is in opensc.conf
  • Have a card which supports key pair generation through pkcs11
  • Modify test program to not call C_Login before C_GenerateKeyPair()
  • Run the test program

Current results: The opensc will prompt for the pin off-band on the pinpad reader

Expected results: The OpenSC should fail with CKR_USER_NOT_LOGGED_IN

I am wondering why the following code does not kick in though:

if (!(session->flags & CKF_RW_SESSION)) {

Logs

See the above referenced comment for more logs.

@Jakuje
Copy link
Member Author

Jakuje commented Feb 13, 2024

Removed from 0.25.0 as it is not that urgent and will require some more testing after applying the changes anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant