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

Authentication key on a card with KDF enabled cannot be used on PKCS#11 #48

Open
wreps8Owt opened this issue Apr 8, 2023 · 5 comments

Comments

@wreps8Owt
Copy link

PKCS#11 is provided by OpenSC.
certtool --ask-pass -s --template ca.tmpl --load-privkey "pkcs11:token=OpenPGP%20card%20%28User%20PIN%29;id=%03;object=Authentication%20key;type=private" --outfile ca.crt can successfully generate a self-signed certificate for personal CA from an OpenPGP card 2.1 from ZeitControl (what https://www.floss-shop.de/en/security-privacy/smartcards/13/openpgp-smart-card-v3.4 used to sell), but failed on my J3H145 running SmartPGP, with the following error error importing key at pkcs11:token=OpenPGP%20card%20%28User%20PIN%29;id=%03;object=Authentication%20key;type=private: PKCS #11 error in data after entering the user PIN. Both card have an RSA key in their Authentication slot.

My J3H145 running SmartPGP has KDF enabled. Is this related?

@wreps8Owt
Copy link
Author

certtool --ask-pass -s --template ca.tmpl --load-privkey "pkcs11:token=OpenPGP%20card%20%28User%20PIN%29;id=%03;object=Authentication%20key;type=private" --outfile ca.cr does work well on another java card running SmartPGP but without KDF enabled, so it seems that enabling KDF may break compatibilities with other applications if they do not support KDF of OpenPGP card 3 standard.

@wreps8Owt wreps8Owt changed the title Authentication key cannot be used on PKCS#11 Authentication key on a card with KDF enabled cannot be used on PKCS#11 Apr 8, 2023
@af-anssi
Copy link
Contributor

af-anssi commented Apr 8, 2023

This problem does not come from the applet but from the OpenSC or GnuPG middleware. The applet does not perform any operation to derive the actual PIN when KDF is enabled; this is done entirely on the "client" side.

@af-anssi
Copy link
Contributor

@wreps8Owt Have you been able to identify which part on the "client" side is responsible of this behavior ?

@wreps8Owt
Copy link
Author

wreps8Owt commented Apr 11, 2023 via email

@af-anssi
Copy link
Contributor

I see you have opened an issue in Opensc OpenSC/OpenSC#2742.

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

2 participants