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

PKCS#15 Init: Couldn't bind to the card: Not supported` #2881

Closed
amusarra opened this issue Sep 29, 2023 · 3 comments
Closed

PKCS#15 Init: Couldn't bind to the card: Not supported` #2881

amusarra opened this issue Sep 29, 2023 · 3 comments

Comments

@amusarra
Copy link

I would like to initialize a TS-CNS (Italian Health Card) Smart Card using the pkcs15-init --erase-card command to delete the contents of the card before proceeding with the command to create the PKCS#15 structure.

Running the command returns the error "Couldn't bind to the card: Not supported".

Running the pkcs15-init -E -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv command it would appear that OpenSC does not find the library for 'itacns' but looking at the project's source code, this card should be supported (see card-itacns.c).

P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card-itacns.c:117:itacns_match_cns_card: Matching 80 against atr[22] == 80
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:385:sc_connect_card: card info name:'CNS card', type:23002, flags:0x0, max_send/recv_size:255/256
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:1612:sc_card_sm_check: called
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:1617:sc_card_sm_check: returning with: 0 (Success)
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:397:sc_connect_card: returning with: 0 (Success)
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-initUsing card driver Italian CNS.
] pkcs15-lib.c:321:sc_pkcs15init_bind: called
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:1062:sc_card_ctl: called
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] card.c:1069:sc_card_ctl: card_ctl(4) not supported
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] pkcs15-lib.c:261:find_library: unable to locate pkcs15init driver for 'itacns'
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] pkcs15-lib.c:345:sc_pkcs15init_bind: Unsupported card driver itacns
P:5551; T:0x8460083328 11:16:11.474 [pkcs15-init] pkcs15-lib.c:347:sc_pkcs15init_bind: Unsupported card driver: -1408 (Not supported)

Console 1 - Output of the command pkcs15-init -E -vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

@Jakuje
Copy link
Member

Jakuje commented Sep 29, 2023

There is no itacns driver in the src/pkcs15init directory. The list of operations in the pkcs11 driver suggests the card is read-only from the opensc side as there are no write/management operations:

https://github.com/OpenSC/OpenSC/blob/master/src/libopensc/card-itacns.c#L501

@dengert
Copy link
Member

dengert commented Sep 29, 2023

There is no profile or routines that can work with pkcs15init in https://github.com/OpenSC/OpenSC/tree/master/src/pkcs15init

Most (if not all) government issued cards are designed to be used by end users. The documentation on how they are initialized maybe proprietary.

OpenSC has 50 card drivers, but only 30 have pkcs15init profiles.

@amusarra
Copy link
Author

Hi @dengert and @Jakuje thanks so much for your quick response.
At this point I close the issue.

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

3 participants