-
Notifications
You must be signed in to change notification settings - Fork 757
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
Add support for Slovenian eID #2564
Comments
I think it would be better to first try to add USB IDs into ccid or another driver (e.g. acr38u), because the chip may be already supported, but the IDs may be unique. Here is an example patch for ccid: --- a/readers/supported_readers.txt
+++ b/readers/supported_readers.txt
@@ -963,6 +963,8 @@
# THRC
0x062D:0x0001:THRC Smart Card Reader
+0x0483:0x00DF:SCAN BIO
+
# VMware
########################## |
I don't see why we would need to do this, since the eID is a smart card and not a USB token. |
The tests so far have shown that the CCID driver is working fine. So adding it to supported_readers.txt is not needed. "Failed to connect to card: Card is invalid or cannot be handled" means that the card was not recognized. How did you produce the output in the gist listed above? Was this opensc-explorer? Most OpenSC tools support the (Although there are many "pkcs15" cards, many need additional code to handle card specific issues or features.) See: https://github.com/OpenSC/OpenSC/wiki/Using-OpenSC to get a debug log which would help to see how far you can get. "man opensc.conf" and https://github.com/OpenSC/OpenSC/blob/master/etc/opensc.conf.example.in to see what can be done. https://github.com/OpenSC/OpenSC/wiki/Environment-variables If you can get it to work with an existing OpenSC driver by forcing the use of a specific driver, then the ATR could be added to that driver. If not, then see:https://github.com/OpenSC/OpenSC/wiki/Adding-a-new-card-driver opensc-explorer and the
|
Yes, the dumps were made with opensc-explorer. I cannot run pkcs15-tool with
This is the debug log of If I set the driver to something that is not |
Just as I posted, I found out I need to enable the driver with |
Not sure. But default is usually used to try and get a new card to work and write a new driver. Your last dump looks promising. Using the modified opensc.conf, can you get I see How do you want to use this card? If its just on windows, use the government's drivers. PKCS15 just defines a file structure, The actual APDUs sent to the card to do crypto operations vary by card and applet on the card. See if you can find any documentation or open source for their drivers. ISO 7816-4 and ISO 7816-8 define the APDUs, but these are so extensible, a new driver maybe needed. If a new driver is needed sometimes running a USB trace or PCSC trace of their windows driver might help. You can try using some of the pkcs15 tools to do a sign and openssl to do the verify. The only way to develop a new driver is for someone with a card, like you, writes a new driver or modify an existing driver. https://github.com/OpenSC/OpenSC/tree/master/src/libopensc contains the drivers as |
The correct link would be Trying test login I get Since the official drivers are not out yet, looks like we will have to wait to advance further. I issued a FOIA request for the APDU specs but got denied with the reason that an NDA was signed between the government and the developer (even though the government posseses such specs). The drivers should be available on all platforms. I suggest we leave this issue open and I will try implementing a driver once I am able to reverse engineer/get the government to give me the APDU spec. |
Sorry about the wrong link. a Google search for: Good luck with obtaining any documentation. Any idea who is the developer? |
The developer is NXP (as can even be seen in the PKCS#15) through a local company (Cetis). The more interesting part was that the public tender had the requirement of either having the card supported in OpenSC or providing middleware and the provider selecting the worse option... Sadly, this is how politics works here. I am also looking at requesting a public interest balance test for the specifications, to be able to get them from the ministry. It also seems that the app we have been testing is a PIN-less app for the low-assurance certificate. I believe the authentication for it is done via PACEv2 (see EF.DIR). The signing and high-assurance certificate seem to lie in an undocumented AID that I will no be able to access until we reverse the APDUs the official middleware will be sending. |
If it's running on Windows, Linux or macOS, you can easily debug the commands sent to card... But be aware, that reverse engineering a card driver is very time consuming without the lack of documentation and detailed knowledge.... |
Actually, at least for authentication, it looks like the auth may be done with PACE. How would I go implementing that? |
For quick testing, you could use |
OK, I have now received the official specs after a long FOIA request debacle. This is everything the government got from NXP (as far as I know). I will not comment on the length or thoroughness of it. I shall try to implement a client soon and report back if I need any help. I will also look into translating the document if necessary |
Ok, looking promising. After running npa-tool with the following -t script:
I get the following:
I don't know how to validate the signature, but the certificate is here |
Further investigation:
Since PACE requires the CAN, it would be nice to check if we can determine if we are communicating over NFC. The card sends response 0x6982 (Security status not satisfied) if we are not using PACE when we need to. I am also unable to access the actual signature and high-trust certificates, as the card replies with 0x6283. The app is also not listed in my EF.DIR. I have a suspicion that they provision these when you personalize the card with an activation code. |
Congrats!
You most likely can use the ATR to detect the contactless mode. Alternatively, if you reader supports the UID command, you can also use the presence of an UID to see if it is connected via NFC ( |
OK, the official software got released today and it seems to just be a localized version of the NXP IDProtect for Athena. Is there any existing support for these? I am also reverse engineering the card activation procedure, which seems to be quite simple, is there interest to add support for that in OpenSC as well? |
Regarding NXP IDProtect with LASER applet used in other countries, found this that could be useful: #1988 (comment) |
Hi,
I am trying to get the Slovenian eID (ATR:
3b:d5:18:ff:81:91:fe:1f:c3:80:73:c8:21:10:0a
) working.The chips are NXP P71 with JCOP 4.
So far I have been able to read EF.DIR to get the AID of
E8:28:BD:08:0F:01:4E:58:50:31
(something ending NXP1). The app seems to be a PKCS#15 app.All the files I could dump are in the gist
Is there a good driver I can already use to try exploring this with pkcs15-tools, as at the moment I get the error of
Failed to connect to card: Card is invalid or cannot be handled
?The text was updated successfully, but these errors were encountered: