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

Transaction Failed on almost any Apdu, when using SIM Cards and ACR38U #30

Closed
AbbassFaytaroony opened this issue Dec 22, 2019 · 5 comments

Comments

@AbbassFaytaroony
Copy link

Hello , thank you for making these tools available! I am trying to test these tools against the following hardware :

  • ACR38U Reader
  • SIM cards ISO 7816-3 compliant

Getting always an error. Ex:
GScriptor:

Beginning script execution...

Sending: A0 A4 00 00 02 3F 00 

Errors During Script Execution: Transaction failed.
Script was executed without error.

Noting that all tools connected successfuly to the reader and performed reset command successfully returning the ATR .

I tried sending the same Apdu from a Java application is throwing :
PCSCException: scard_e_not_transacted. This maybe related to the current issue

@LudovicRousseau
Copy link
Owner

https://pcsclite.apdu.fr/#support

I need, at least, a pcscd trace log.

@AbbassFaytaroony
Copy link
Author

AbbassFaytaroony commented Dec 22, 2019

Sure! Here is the trace of :

  • reset command,
  • then one of the apdus causing the problem: A0 A4 00 00 02 3F 00
00000008 winscard.c:431:SCardConnect() Active Protocol: T=0
00000009 winscard.c:456:SCardConnect() hCard Identity: 4d390b76
00000007 winscard.c:518:SCardConnect() UnrefReader() count was: 2
00000009 winscard_svc.c:510:ContextThread() CONNECT rv=0x0 for client 14
09410248 winscard_svc.c:362:ContextThread() Received command: RECONNECT from client 14
00000032 winscard.c:532:SCardReconnect() Attempting reconnect to token.
00000009 readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000011 ifdhandler.c:2658:IFDHICCPresence() usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000011 -> 000000 65 00 00 00 00 00 0C 00 00 00 
00000605 <- 000000 81 00 00 00 00 00 0C 00 00 00 
00000026 ifdhandler.c:2868:IFDHICCPresence() Card present
00000010 ifdhandler.c:1391:IFDHPowerICC() action: Reset, usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000010 -> 000000 62 00 00 00 00 00 0D 01 00 00 
00150444 <- 000000 80 06 00 00 00 00 0D 00 00 00 3B 04 A2 13 10 91 
00000036 winscard.c:612:SCardReconnect() Reset complete.
00000008 Card ATR: 3B 04 A2 13 10 91 
00000007 prothandler.c:108:PHSetProtocol() Attempting PTS to T=0
00000007 ifdhandler.c:846:IFDHSetProtocolParameters() protocol T=0, usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000007 ifdhandler.c:933:IFDHSetProtocolParameters() Specific mode
00000009 ifdhandler.c:1271:IFDHSetProtocolParameters() Communication timeout: 232133 ms
00000006 commands.c:2353:SetParameters() length: 5 bytes
00000011 -> 000000 61 05 00 00 00 00 0E 00 00 00 11 00 00 0A 00 
00000553 <- 000000 82 00 00 00 00 00 0E 40 00 00 
00000023 commands.c:2379:SetParameters Command not supported or not allowed
00000008 winscard.c:731:SCardReconnect() Active Protocol: T=0
00000006 winscard.c:821:SCardReconnect() UnrefReader() count was: 2
00000007 winscard_svc.c:529:ContextThread() RECONNECT rv=0x0 for client 14
00000150 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000148 winscard_svc.c:362:ContextThread() Received command: STATUS from client 14
00000035 readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000007 winscard.c:1300:SCardStatus() UnrefReader() count was: 2
00000009 winscard_svc.c:629:ContextThread() STATUS rv=0x0 for client 14
00000099 winscard_svc.c:362:ContextThread() Received command: CMD_GET_READERS_STATE from client 14
00000073 winscard_svc.c:362:ContextThread() Received command: STATUS from client 14
00000022 readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000005 winscard.c:1300:SCardStatus() UnrefReader() count was: 2
00000006 winscard_svc.c:629:ContextThread() STATUS rv=0x0 for client 14
07487762 winscard_svc.c:362:ContextThread() Received command: TRANSMIT from client 14
00000048 readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000011 winscard.c:1595:SCardTransmit() Send Protocol: T=0
00000013 APDU: A0 A4 00 00 02 3F 00 
00000011 ifdhandler.c:1622:IFDHTransmitToICC() usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000009 commands.c:1854:CmdXfrBlockTPDU_T0() T=0: 7 bytes
00000020 -> 000000 6F 07 00 00 00 00 0F 00 00 00 A0 A4 00 00 02 3F 00 
01072103 <- 000000 80 00 00 00 00 00 0F 40 FE 00 
00000035 commands.c:1604:CCID_Receive Card absent or mute
00000008 SW: 
00000006 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
00000006 winscard.c:1620:SCardTransmit() Card not transacted: 0x80100016
00000005 winscard.c:1640:SCardTransmit() UnrefReader() count was: 2
00000008 winscard_svc.c:682:ContextThread() TRANSMIT rv=0x80100016 for client 14
00000243 winscard_svc.c:362:ContextThread() Received command: DISCONNECT from client 14
00000041 readerfactory.c:848:RFReaderInfoById() RefReader() count was: 1
00000011 winscard.c:878:SCardDisconnect() Active Contexts: 1
00000008 winscard.c:879:SCardDisconnect() dwDisposition: 0
00000009 winscard.c:1014:SCardDisconnect() powerState: POWER_STATE_GRACE_PERIOD
00000011 ifdhandler.c:511:IFDHGetCapabilities() tag: 0xFB2, usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000008 winscard.c:1027:SCardDisconnect() Stopping polling thread
00000007 ifdhandler.c:476:IFDHStopPolling() usb:072f/90cc:libudev:0:/dev/bus/usb/002/011 (lun: 0)
00000065 winscard.c:1040:SCardDisconnect() UnrefReader() count was: 2
00000018 winscard_svc.c:547:ContextThread() DISCONNECT rv=0x0 for client 14

@LudovicRousseau
Copy link
Owner

The reader reported "Card absent or mute".
It looks like you are using a memory card https://smartcard-atr.apdu.fr/parse?ATR=3B+04+A2+13+10+91, and not a smart card. I am not surprised it does not work.

@AbbassFaytaroony
Copy link
Author

Thank you for your response! The thing keeping me thinking about it is that the link you sent indicated the cards might be PM2P Chipkarte SLE 4442, Code FFFFFF exactly as the supplier indicated. Any other thought or hint?

@LudovicRousseau
Copy link
Owner

Try to find documentation about using MEMORY cards with your reader.
Maybe your reader can use it.

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

2 participants