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 misidentification #3106
Comments
From the source code, the second should be identified as 840, but it looks like the mask overlaps since #2958. OpenSC/src/libopensc/card-idprime.c Lines 72 to 75 in 26b9067
Is it correct that it should be 840? The workaround might be to change the order of the masks. |
Yes, one should be 840. The other is OK to be 940. I am not familiar with the masks usage. |
If I understand properly the mentioned PR turned off the bits that identify the card. What was the reason @Nihlus ? |
No, it set the mask to 0x00, which means any bits match there. It looks like something we overlooked and I think just changing order of the entries should solve the issue. But we will need to test it with various cards ... |
I have 940 and 840. Will try changing order. |
But this also means that 940 and 940C overlap. |
Changing order fixes identification, but it uncovered that 840 does not have EC support. Specs say:
|
This is set just for 930 and 940, but it is also usable for MD 840: OpenSC/src/libopensc/card-idprime.c Lines 656 to 665 in 26b9067
|
I am not sure about the ext_flags. |
Yeah, I just updated the mask so that the 940 card I had passed (enabling the bits that differed). I don't have any other IDPrime cards to test with, so I went with the naive approach. Changing as previously suggested seems like a fair option. |
@msetina do you want to submit a PR with your changes getting the 940 card detected correctly? |
I was wondering why this card driver does not support key generation. |
Because nobody implemented it. There is no specification for this applet. If you would like to capture the APDU trace of official driver while generating keys and implement it into opensc, we would be happy to take your patches. But so far we had quite enough work to get the card detection and readonly operations right (as you can see). |
Running OpenSC 0.25.1:
Got two cards:
ATR: 3b:7f:96:00:00:80:31:80:65:b0:85:59:56:fb:12:0f:fe:82:90:00
and
ATR: 3b:7f:96:00:00:80:31:80:65:b0:85:03:00:ef:12:0f:fe:82:90:00
Both identify as Gemalto IDPrime 940.
Code
The text was updated successfully, but these errors were encountered: