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

pkcs15-jpki.c - minidriver problem with reading public key #3182

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dengert
Copy link
Member

@dengert dengert commented Jun 15, 2024

Add SC_PKCS15_CO_FLAG_PRIVATE on "Digital Signature Public Key" and set pubkey_obj.flags and pubkey_obj.auth_id to use the Sign KEY so minidriver.c can request the PIN before reading the public key. Card enforces this as per specs.

Partially Fixes #3169 Only pkcs15-jpki.c is changed.

Not tested with any card.

In addition to changes in #3167 that address "user_consent" using "PinCacheAlwaysPrompt", The JPKI card forces the user to verify the Sign PIN before the public key is read. But to use the Sign KEY, Windows minidriver specs V7.07 says: the "CCP_CONTAINER_INFO" contains "cbSigPublicKey" and "pbSigPublicKey" which is needed before the key is selected.

It might be possible to add bogus information in these and substitute the real values at a later time. But this will require someone with a working card.

Also possible to use code from pkcs15-dnie.c which had its own dmie_ask_user_consent.

On branch minidriver-PinCacheAlwaysPrompt
Changes to be committed:
modified: libopensc/pkcs15-jpki.c

On branch JPKI-Improvements
Changes to be committed:
modified: libopensc/pkcs15-jpki.c

Checklist
  • Documentation is added or updated
  • New files have a LGPL 2.1 license statement
  • PKCS#11 module is tested
  • Windows minidriver is tested
  • macOS tokend is tested

Add SC_PKCS15_CO_FLAG_PRIVATE on "Digital Signature Public Key" and
set pubkey_obj.flags and pubkey_obj.auth_id to use the Sign KEY
so minidriver.c can request the pin before reading the public key.
Card enforces this as perspecs.

Partial fix for OpenSC#3169 Only pkcs15-jpki.c is changed.

In addition to changes in OpenSC#3167 that address "user_consent" using
"PinCacheAlwaysPrompt", The JPKI card forces the user to verify the Sign PIN
before the public key is read. But to use the Sign KEY,
Windows minidriver specs V7.07 says: the "CCP_CONTAINER_INFO"
contains "cbSigPublicKey" and "pbSigPublicKey"
which is needed before the key is selected.

It might be possible to add bogus information in these and
substitute the real values at a later time. But this will require
someone with a working card.

 On branch minidriver-PinCacheAlwaysPrompt
 Changes to be committed:
	modified:   libopensc/pkcs15-jpki.c

 On branch JPKI-Improvments
 Changes to be committed:
	modified:   libopensc/pkcs15-jpki.c
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

Successfully merging this pull request may close these issues.

OpenSC Minidriver Does Not Display the Second Key Container of JPKI Card When certutil -scinfo Is Executed
1 participant