1

I'm having issues accessing SLE4428 cards under Windows 10 using an ACS ACR38U-I1, Python 3.7 and pyscard. I'm using the latest driver the manufacturer currently offers for Windows.

The main problem is that running certain APDUs fails, stating Failed to transmit with protocol T0. Falscher Parameter (= wrong parameter, error code 87). Running the exact same code with the same reader on a Raspberry Pi works flawlessly however. I have not installed any specific drivers on the Pi.

I'm using this code for running APDUs:

    from smartcard.CardType import AnyCardType
    from smartcard.CardConnection import CardConnection
    from smartcard.CardRequest import CardRequest
    
    cardtype = AnyCardType()
    cardrequest = CardRequest(timeout=1, cardType=cardtype)
    cardservice = cardrequest.waitforcard()
    cardservice.connection.connect(CardConnection.T0_protocol)
    apdu = [0xff, 0xb0, 0x00, 0x00, 0xff] #READ_MEMORY_CARD
    response, sw1, sw2 = cardservice.connection.transmit(apdu, CardConnection.T0_protocol)
    print('response: ', response, ' status words: ', "%x %x" % (sw1, sw2))

This code works fine on both platforms. Trying to authenticate using [0xff, 0x20, 0x00, 0x01, 0x03, 0xff, 0xff] however results in the crash described on Windows. I've tried the stock Windows driver as well as playing around with different protocols, no success.

Another weird behaviour that is exclusive to Windows: When inserting a card, the reader's LED flashes quickly and it takes around 9 seconds before the card can be accessed at all.

This is the first time I'm trying to interface with hardware, so it's probably something obvious, but I cannot figure it out. I'd appreciate any input and/or recommendations for (still available) readers that are known to work in this configuration.

guidot
  • 5,095
  • 2
  • 25
  • 37
lrv89
  • 11
  • 3
  • 1
    WRT to the flashing: you probably need to disable to disable the certificate propagation service in Windows and see if that helps. With regards to the authenticate APDU: the 5th byte is valued 0x03, which means that Nc is valued 3, but you only supply 2 bytes in the command data (0xFF and 0xFF). – Maarten Bodewes Oct 23 '21 at 23:15
  • Disabling the certificate propagation service helps somewhat with the unresponsive reader: With a freshly plugged in reader and disabled service, the first 3-4 cards still cause a flashing LED and are slow to access. After these first few though, the cards are instantly accessible and the readers LED stays lit. – lrv89 Oct 25 '21 at 16:53

1 Answers1

0

APDU CLA value 'FF' isn't allowed according to ISO 7816-4. Manufacturers of PC/SC readers sometime support APDU commands with CLA=FF to implement some specific functions like access to MIFARE cards or tuning of communication protocol settings.

nvf
  • 465
  • 1
  • 7
  • The SLE4428 mentioned in the question **is** a memory card... Given the question I wonder if this isn't already known by the author. – Maarten Bodewes Oct 25 '21 at 22:46