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

card-idprime.c : add support for Gemalto IDPrime 940C #2941

Merged
merged 1 commit into from Dec 1, 2023

Conversation

vbonamy
Copy link
Contributor

@vbonamy vbonamy commented Nov 23, 2023

Define Gemalto IDPrime 940C as SC_CARD_TYPE_IDPRIME_940

  • 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

We have recently encountered an issue with OpenSC when using the Gemalto IDPrime 940C card, which is a newer variant of the Gemalto IDPrime 940. After investigating the problem, we have made modifications to OpenSC to add support for Gemalto IDPrime 940C.

The ATR of our Gemalto IDPrime 940C card is 3b:7f:96:00:00:80:31:80:65:b0:85:05:00:39:12:0f:fe:82:90:00.

Without our patch, attempting to use Gemalto IDPrime 940C (via pkcs11-tool --login --test ) resulted in the following error:

error: PKCS11 function C_SignFinal failed: rv = CKR_FUNCTION_NOT_SUPPORTED (0x54)

With the applied patch, we have successfully authenticated using the PIN code and signed documents without encountering any issues.

We acknowledge that we may not be deeply familiar with the OpenSC codebase and the subtleties regarding ATRs. However, with the provided patch, we have successfully resolved the issue and verified that Gemalto IDPrime 940C works as expected.

Thank you for your time.

Define Gemalto IDPrime 940C as SC_CARD_TYPE_IDPRIME_940
Copy link
Member

@Jakuje Jakuje left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good! Thank you for your contribution and confirmation it works for you!

Comment on lines 61 to +67
"ff:ff:00:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:00:00:ff:ff:ff",
"Gemalto IDPrime 940",
SC_CARD_TYPE_IDPRIME_940, 0, NULL },
{ "3b:7f:96:00:00:80:31:80:65:b0:85:05:00:39:12:0f:fe:82:90:00",
"ff:ff:00:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:00:00:ff:ff:ff",
"Gemalto IDPrime 940C",
SC_CARD_TYPE_IDPRIME_940, 0, NULL },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passing the ATR into the ATR parser, the block with difference is a block pre-issuing data, but it looks like the rest is the same for also the IDPrime 840 so I am ok with the change.

https://smartcard-atr.apdu.fr/parse?ATR=3b:7f:96:00:00:80:31:80:65:b0:85:05:00:39:12:0f:fe:82:90:00

@Jakuje Jakuje added this to In progress in OpenSC 0.24.0 via automation Nov 27, 2023
@Jakuje
Copy link
Member

Jakuje commented Nov 27, 2023

This one is trivial enough so we can get it into the 0.24.0 too.

@frankmorgner frankmorgner merged commit 258bfc8 into OpenSC:master Dec 1, 2023
34 of 36 checks passed
OpenSC 0.24.0 automation moved this from In progress to Done Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants