brandoncheah
Posts: 28
Joined: Thu Sep 27, 2018 9:52 am

OpenSC Library Smartcard Reader: Transmit Failed

Tue Nov 03, 2020 3:01 am

I am trying to read data from our Malaysia Identification card (MyKAD) a type of smart card.
Using OpenSC library i manage to retrieve the data from the smartcard using APDU: https://github.com/OpenSC/OpenSC/wiki/Malaysian-MyKAD

I installed using

Code: Select all

sudo apt-get install -y opensc
, although opensc shows its an unsupported card but I am still able to retrieve the data.

The problem now is that I have 2 Raspberry pi 3B+ and 1 Raspberry Pi 4 Model B (1GB), opensc is able to read in Raspberry Pi 4 but not in Raspberry pi 3B+

Raspberry pi 3B+ Error shown is:

Code: Select all

Using reader with a card: Gemalto PC Twin Reader (438F1742) 00 00
Connecting to card in reader Gemalto PC Twin Reader (438F1742) 00 00...
Using card driver Default driver for unknown cards.
Sending: 00 A4 04 00 0A A0 00 00 00 74 4A 50 4E 00 10 
Received (SW1=0x90, SW2=0x00)
Sending: C8 32 00 00 05 08 00 00 96 00 
APDU transmit failed: Transmit failed

Raspberry pi 4, no error output:

Code: Select all

sing reader with a card: Gemalto PC Twin Reader (438F1742) 00 00
Sending: 00 A4 04 00 0A A0 00 00 00 74 4A 50 4E 00 10 
Received (SW1=0x90, SW2=0x00)
Sending: C8 32 00 00 05 08 00 00 96 00 
Received (SW1=0x91, SW2=0x08)
Sending: CC 00 00 00 08 01 00 01 00 03 00 96 00 
Received (SW1=0x94, SW2=0x96)
Sending: CC 06 00 00 96 
Received (SW1=0x90, SW2=0x00):
43 48 45 41 48 20 5A 48 45 4E 47 20 58 55 41 4E **DATA**
20 42 52 41 4E 44 4F 4E 20 20 20 20 20 20 20 20  **DATA**        
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20                 
20 20 20 20 20 20                            
Both checked having the same version:

Code: Select all

opensc is already the newest version (0.19.0-1)
I have install the library with the same methods and checked the package using

Code: Select all

dpkg -L opensc-pkcs11
both raspberry having the same output.:

Code: Select all

.
/usr
/usr/lib
/usr/lib/arm-linux-gnueabihf
/usr/lib/arm-linux-gnueabihf/libopensc.so.6.0.0
/usr/lib/arm-linux-gnueabihf/libsmm-local.so.6.0.0
/usr/lib/arm-linux-gnueabihf/onepin-opensc-pkcs11.so
/usr/lib/arm-linux-gnueabihf/opensc-pkcs11.so
/usr/lib/arm-linux-gnueabihf/pkcs11
/usr/lib/arm-linux-gnueabihf/pkcs11-spy.so
/usr/share
/usr/share/doc
/usr/share/doc/opensc-pkcs11
/usr/share/doc/opensc-pkcs11/NEWS.gz
/usr/share/doc/opensc-pkcs11/README.md
/usr/share/doc/opensc-pkcs11/changelog.Debian.gz
/usr/share/doc/opensc-pkcs11/copyright
/usr/share/p11-kit
/usr/share/p11-kit/modules
/usr/share/p11-kit/modules/opensc-pkcs11.module
/usr/lib/arm-linux-gnueabihf/libopensc.so.6
/usr/lib/arm-linux-gnueabihf/libsmm-local.so.6
/usr/lib/arm-linux-gnueabihf/pkcs11/onepin-opensc-pkcs11.so
/usr/lib/arm-linux-gnueabihf/pkcs11/opensc-pkcs11.so
/usr/lib/arm-linux-gnueabihf/pkcs11/pkcs11-spy.so
/usr/share/doc/opensc-pkcs11/README
Is there any more method that I should try to troubleshoot?
Is it possible a hardware limitation or difference on the raspberry pi 3B and 4B? But the smartcard reader is just using USB.
Smartcard reader model: Gemalto IDBridge CT40

Return to “Advanced users”