From: SourceForge.net <no...@so...> - 2011-10-19 13:20:02
|
Bugs item #3072003, was opened at 2010-09-20 18:09 Message generated for change (Comment added) made by ludov You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957072&aid=3072003&group_id=196342 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: PCSC wrapper Group: None >Status: Closed Resolution: Accepted Priority: 5 Private: No Submitted By: https://www.google.com/accounts () Assigned to: jean-daniel aussel (jdaussel) Summary: crashes on GET RCORD and return FCP Initial Comment: on Mac: It is not possible, to run any command-apdu, that should return data. ---------- Primary Environment: Mac OSX 10.6.4 libusb-1.0.8 ccid-1.4.0 pcsc-lite-1.6.4 pyscard-1.6.12-py2.6-macosx10.6 Python 2.6 **************************************** Card / Reader: CyberJack 00 00 (Reiner SCT) Smartcard: German Geldkarte ATR: 3B FF 18 00 FF 81 31 FE 45 65 63 0D 07 63 07 64 00 0D 90 59 52 00 06 15 9A **************************************** Testscript: from smartcard.CardType import AnyCardType from smartcard.CardRequest import CardRequest from smartcard.util import toHexString SELMF = [0x00, 0xA4, 0x00, 0x0C] SELID = [0x00, 0xA4, 0x02, 0x0C, 0x02, 0x00, 0x03] SELIDplus = [0x00, 0xA4, 0x02, 0x04, 0x02, 0x00, 0x03, 0x00] GETREC = [0x00, 0xB2, 0x01, 0x04, 0x00] cardtype = AnyCardType() cardrequest = CardRequest( timeout=10, cardType=cardtype ) cardservice = cardrequest.waitforcard() cardservice.connection.connect() # to have at least one success apdu = SELMF print "----------- apdu:", toHexString(apdu) response, sw1, sw2 = cardservice.connection.transmit( apdu ) if sw1 != 0x90: print "error:", ("%x %x" % (sw1, sw2)); exit(1) print "sw1-2:", ("%x %x" % (sw1, sw2)) # position on EF_ID file (FID: 00 03) apdu = SELID print "----------- apdu:", toHexString(apdu) response, sw1, sw2 = cardservice.connection.transmit( apdu ) if sw1 != 0x90: print "error:", ("%x %x" % (sw1, sw2)); exit(1) print "sw1-2:", ("%x %x" % (sw1, sw2)) print "response:", toHexString(response) # get first an only record apdu = GETREC print "----------- apdu:", toHexString(apdu) response, sw1, sw2 = cardservice.connection.transmit( apdu ) print "sw1-2:", ("%x %x" % (sw1, sw2)); exit(1) **************************************** Output: ----------- apdu: 00 A4 00 0C sw1-2: 90 0 ----------- apdu: 00 A4 02 0C 02 00 03 sw1-2: 90 0 response: ----------- apdu: 00 B2 01 04 00 Traceback (most recent call last): File "MyTestAPDU.py", line 31, in <module> response, sw1, sw2 = cardservice.connection.transmit( apdu ) File "/Library/Python/2.6/site-packages/smartcard/CardConnectionDecorator.py", line 82, in transmit return self.component.transmit(bytes, protocol) File "/Library/Python/2.6/site-packages/smartcard/CardConnection.py", line 140, in transmit data, sw1, sw2 = self.doTransmit(bytes, protocol) File "/Library/Python/2.6/site-packages/smartcard/pcsc/PCSCCardConnection.py", line 175, in doTransmit raise CardConnectionException('Failed to transmit with protocol ' + dictProtocolHeader[pcscprotocolheader] + '. ' + SCardGetErrorMessage(hresult)) smartcard.Exceptions.CardConnectionException: Failed to transmit with protocol T1. Transaction failed. **************************************** Output when using SELIDplus (try to get FCP): ----------- apdu: 00 A4 00 0C sw1-2: 90 0 ----------- apdu: 00 A4 02 04 02 00 03 00 Traceback (most recent call last): File "MyTestAPDU.py", line 24, in <module> response, sw1, sw2 = cardservice.connection.transmit( apdu ) File "/Library/Python/2.6/site-packages/smartcard/CardConnectionDecorator.py", line 82, in transmit return self.component.transmit(bytes, protocol) File "/Library/Python/2.6/site-packages/smartcard/CardConnection.py", line 140, in transmit data, sw1, sw2 = self.doTransmit(bytes, protocol) File "/Library/Python/2.6/site-packages/smartcard/pcsc/PCSCCardConnection.py", line 175, in doTransmit raise CardConnectionException('Failed to transmit with protocol ' + dictProtocolHeader[pcscprotocolheader] + '. ' + SCardGetErrorMessage(hresult)) smartcard.Exceptions.CardConnectionException: Failed to transmit with protocol T1. Transaction failed. **************************************** Problem using an APDU, that should return a response, it is not possible to specify any expected Length: Transaction failed. **************************************** Running on Windows everything works On the same machine running Win7-32 in Parallels Desktop 6 using the same equipment and the Software Chipcard Master (http://www.chipcardmaster.de/) everything runs fine. ---------------------------------------------------------------------- >Comment By: Ludovic Rousseau (ludov) Date: 2011-10-19 15:20 Message: Do not use your onw built of pcsc-lite on Mac OS X. Unless you really know what you are doing. This is not a bug in pyscard. Closing. ---------------------------------------------------------------------- Comment By: Ludovic Rousseau (ludov) Date: 2011-01-04 15:34 Message: You should not replace PC/SC on Mac OS X. Apple provides its own version of pcsc-lite. Can you reproduce the bug on GNU/Linux? Can you provide a pcscd trace of your bug? See http://pcsclite.alioth.debian.org/ccid.html#support ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=957072&aid=3072003&group_id=196342 |