You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(10) |
Feb
(10) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
(17) |
Sep
(9) |
Oct
(10) |
Nov
(2) |
Dec
(5) |
2009 |
Jan
(17) |
Feb
(8) |
Mar
(10) |
Apr
(1) |
May
|
Jun
(11) |
Jul
(18) |
Aug
|
Sep
|
Oct
(10) |
Nov
(40) |
Dec
(4) |
2010 |
Jan
(2) |
Feb
(5) |
Mar
(13) |
Apr
(14) |
May
(27) |
Jun
(86) |
Jul
(1) |
Aug
(12) |
Sep
|
Oct
(2) |
Nov
(3) |
Dec
(5) |
2011 |
Jan
|
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
(11) |
Aug
(1) |
Sep
(3) |
Oct
(65) |
Nov
|
Dec
(1) |
2012 |
Jan
(1) |
Feb
(4) |
Mar
(6) |
Apr
(6) |
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(12) |
Oct
(3) |
Nov
(1) |
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
(1) |
2014 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(24) |
Dec
(10) |
2015 |
Jan
(1) |
Feb
(10) |
Mar
|
Apr
|
May
(1) |
Jun
(15) |
Jul
(4) |
Aug
(2) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
From: <lu...@us...> - 2009-06-12 09:55:54
|
Revision: 289 http://pyscard.svn.sourceforge.net/pyscard/?rev=289&view=rev Author: ludov Date: 2009-06-12 09:55:47 +0000 (Fri, 12 Jun 2009) Log Message: ----------- stress test parseATR with the ilist of known ATRs Added Paths: ----------- trunk/contrib/parseATR/stress_test.py Added: trunk/contrib/parseATR/stress_test.py =================================================================== --- trunk/contrib/parseATR/stress_test.py (rev 0) +++ trunk/contrib/parseATR/stress_test.py 2009-06-12 09:55:47 UTC (rev 289) @@ -0,0 +1,40 @@ +#! /usr/bin/env python +""" + stress_test.py + Copyright (C) 2009 Ludovic Rousseau + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +""" + +import sys, string +import parseATR + +List = "/usr/local/share/pcsc/smartcard_list.txt" + +if __name__ == "__main__": + if len(sys.argv) > 1: + List = sys.argv[1] + + for atr in open(List): + if atr[0] != "3": + continue + if "[" in atr: + continue + if "." in atr: + continue + if "?" in atr: + continue + print atr + parseATR.atr_display_txt(parseATR.parseATR(atr)) Property changes on: trunk/contrib/parseATR/stress_test.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-06-09 14:23:10
|
Revision: 288 http://pyscard.svn.sourceforge.net/pyscard/?rev=288&view=rev Author: ludov Date: 2009-06-09 14:22:58 +0000 (Tue, 09 Jun 2009) Log Message: ----------- use command line arguments Modified Paths: -------------- trunk/contrib/parseATR/parseATR.py Modified: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py 2009-06-09 13:56:33 UTC (rev 287) +++ trunk/contrib/parseATR/parseATR.py 2009-06-09 14:22:58 UTC (rev 288) @@ -421,8 +421,12 @@ print "WRONG CHECKSUM, expected 0x%02X" % tck if __name__ == "__main__": - #ATR = "3B A7 00 40 18 80 65 A2 08 01 01 52" - ATR = "3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 30 31 31 20 52 65 76 42 30 36 4E" + import sys + if len(sys.argv) > 1: + ATR = " ".join(sys.argv[1:]) + else: + #ATR = "3B A7 00 40 18 80 65 A2 08 01 01 52" + ATR = "3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 30 31 31 20 52 65 76 42 30 36 4E" atr = parseATR(ATR) print "ATR:", ATR atr_display_txt(atr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-06-09 14:05:18
|
Revision: 287 http://pyscard.svn.sourceforge.net/pyscard/?rev=287&view=rev Author: ludov Date: 2009-06-09 13:56:33 +0000 (Tue, 09 Jun 2009) Log Message: ----------- more debug Modified Paths: -------------- trunk/contrib/parseATR/parseATR.py Modified: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py 2009-06-08 13:54:54 UTC (rev 286) +++ trunk/contrib/parseATR/parseATR.py 2009-06-09 13:56:33 UTC (rev 287) @@ -47,6 +47,10 @@ def parseATR(atr_txt): atr_txt = normalize(atr_txt) atr = {} + + # the ATR itself as a list of integers + atr["atr"] = atr_txt + # store TS and T0 atr["TS"] = atr_txt[0] atr["T0"] = TDi = atr_txt[1] @@ -91,7 +95,7 @@ # Store TCK if (atr.has_key("TCK")): - atr["TCK"] = atr_txt[pointer] + atr["TCK"] = atr_txt[-1] return atr @@ -106,16 +110,16 @@ def TA2(v): F = v >> 4 D = v & 0xF - text = "Protocol to be used in spec mode: T=%s" % (D), + text = "Protocol to be used in spec mode: T=%s" % (D) if (F & 0x8): - text = text + " - Unable to change", + text += " - Unable to change" else: - text = text + " - Capable to change", + text += " - Capable to change" if (F & 0x1): - text = text + " - implicity defined" + text += " - implicity defined" else: - text = text + " - defined by interface bytes" + text += " - defined by interface bytes" return text @@ -181,9 +185,9 @@ return text def TC1(v): - text = "Extra guard time:", v, + text = "Extra guard time: %d" % v if (v == 255): - text += "(special value)" + text += " (special value)" return text def TC2(v): @@ -198,9 +202,9 @@ def TCn(i, v): text = "" if (T == 1): - text = "Error detection code: ", + text = "Error detection code: " if (v == 1): - text += "CRC"; + text += "CRC" else: if (v == 0): text += "LRC" @@ -333,7 +337,7 @@ if hb_category == None: return text - text += " Category indicator byte: %02X" % hb_category + text += " Category indicator byte: 0x%02X" % hb_category if hb_category == 0x00: text += " (compact TLV data object)\n"; @@ -372,6 +376,15 @@ return text +def compute_tck(atr): + # do not include TS byte + s = atr["atr"][0]; + for e in atr["atr"]: + s ^= e + # remove TCK + s ^= atr["atr"][-1]; + return s + def atr_display_txt(atr): TS = {0x3B: "Direct Convention", 0x3F: "Inverse Convention"} print "TS = 0x%02X --> %s" % (atr["TS"], TS[atr["TS"]]) @@ -398,8 +411,18 @@ print "0x%02X" % b, print print analyse_histrorical_bytes(atr["hb"]) - + + if (atr.has_key("TCK")): + print ("TCK = 0x%02X" % atr["TCK"]), + tck = compute_tck(atr) + if tck == atr["TCK"]: + print "(correct checksum)" + else: + print "WRONG CHECKSUM, expected 0x%02X" % tck + if __name__ == "__main__": - atr = parseATR("3B A7 00 40 18 80 65 A2 08 01 01 52") - #atr = parseATR("3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 30 31 31 20 52 65 76 42") + #ATR = "3B A7 00 40 18 80 65 A2 08 01 01 52" + ATR = "3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 30 31 31 20 52 65 76 42 30 36 4E" + atr = parseATR(ATR) + print "ATR:", ATR atr_display_txt(atr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-06-08 15:50:01
|
Revision: 286 http://pyscard.svn.sourceforge.net/pyscard/?rev=286&view=rev Author: ludov Date: 2009-06-08 13:54:54 +0000 (Mon, 08 Jun 2009) Log Message: ----------- debug historic bytes parsing Modified Paths: -------------- trunk/contrib/parseATR/parseATR.py Modified: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py 2009-06-08 13:36:32 UTC (rev 285) +++ trunk/contrib/parseATR/parseATR.py 2009-06-08 13:54:54 UTC (rev 286) @@ -238,16 +238,18 @@ tag = tlv / 16 len = tlv % 16 + text += " Tag: %d, Len: %d" % (tag, len) + if tag == 1: - text += " (country code, ISO 3166-1)" + text += " (country code, ISO 3166-1)\n" text += " Country code: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) elif tag == 2: - text += " (issuer identification number, ISO 7812-1)"; + text += " (issuer identification number, ISO 7812-1)\n"; text += " Issuer identification number: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) elif tag == 3: - text += " (card service data byte)" + text += " (card service data byte)\n" cs = historical_bytes.pop(0) if cs == None: text += " Error in the ATR: expecting 1 byte and got 0" @@ -256,19 +258,19 @@ text += cs(cs) elif tag == 4: - text += " (initial access data)" + text += " (initial access data)\n" text += " Initial access data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) elif tag == 5: - text += " (card issuer's data)" + text += " (card issuer's data)\n" text += " Card issuer data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) elif tag == 6: - text += " (pre-issuing data)" + text += " (pre-issuing data)\n" text += " Data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) elif tag == 7: - text += " (card capabilities)" + text += " (card capabilities)\n" if len == 1: sm = historical_bytes.pop(0) text += " Selection methods: %d" % sm @@ -294,7 +296,7 @@ text += " wrong ATR" elif tag == 8: - text += " (status indicator)" + text += " (status indicator)\n" if len == 1: lcs = historical_bytes.pop(0) text += " LCS (life card cycle): %d" % lcs @@ -310,13 +312,17 @@ text += " SW: %02X %02X" % (sw1, sw2) elif tag == 15: - text += " (application identifier)" + text += " (application identifier)\n" text += " Application identifier: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) else: - text += " (unknown)" + text += " (unknown)\n" text += " Value: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + # consume len bytes of historic + for i in range(len): + historical_bytes.pop(0) + return text def analyse_histrorical_bytes(historical_bytes): @@ -327,6 +333,8 @@ if hb_category == None: return text + text += " Category indicator byte: %02X" % hb_category + if hb_category == 0x00: text += " (compact TLV data object)\n"; @@ -347,7 +355,7 @@ text += " SW: %02X%02X (%s)" % (sw1, sw1, "") #Chipcard::PCSC::Card::ISO7816Error("$sw1 $sw2")) elif hb_category == 0x80: - text += " (compact TLV data object)" + text += " (compact TLV data object)\n" while len(historical_bytes) > 0: text += compact_tlv(historical_bytes) @@ -388,6 +396,7 @@ print "Historical bytes: ", for b in atr["hb"]: print "0x%02X" % b, + print print analyse_histrorical_bytes(atr["hb"]) if __name__ == "__main__": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-06-08 15:26:36
|
Revision: 285 http://pyscard.svn.sourceforge.net/pyscard/?rev=285&view=rev Author: ludov Date: 2009-06-08 13:36:32 +0000 (Mon, 08 Jun 2009) Log Message: ----------- do not establish a PCSC context at loading but only when needed It is now possible to use, for example, smartcard.util.toHexString() even if pcscd is not started (default on Mac OS X with no reader) Modified Paths: -------------- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py Modified: trunk/pyscard/src/smartcard/pcsc/PCSCReader.py =================================================================== --- trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2009-06-08 13:28:49 UTC (rev 284) +++ trunk/pyscard/src/smartcard/pcsc/PCSCReader.py 2009-06-08 13:36:32 UTC (rev 285) @@ -31,9 +31,7 @@ from smartcard.pcsc.PCSCExceptions import * from smartcard.scard import * -hcontext = PCSCContext().getContext() - -def __PCSCreaders__( groups=[] ): +def __PCSCreaders__( hcontext, groups=[] ): """Returns the list of PCSC smartcard readers in PCSC group. If group is not specified, returns the list of all PCSC smartcard readers. @@ -102,7 +100,9 @@ def readers( groups=[] ): creaders=[] - for reader in __PCSCreaders__( groups ): + hcontext = PCSCContext().getContext() + + for reader in __PCSCreaders__( hcontext, groups ): creaders.append( ReaderFactory.createReader( 'smartcard.pcsc.PCSCReader.PCSCReader', reader ) ) return creaders This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-06-08 13:28:50
|
Revision: 284 http://pyscard.svn.sourceforge.net/pyscard/?rev=284&view=rev Author: ludov Date: 2009-06-08 13:28:49 +0000 (Mon, 08 Jun 2009) Log Message: ----------- fix the DeprecationWarning: raising a string exception is deprecated Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2009-04-18 08:07:15 UTC (rev 283) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_control.py 2009-06-08 13:28:49 UTC (rev 284) @@ -31,7 +31,7 @@ try: hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if hresult!=0: - raise 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) print 'Context established!' try: @@ -85,7 +85,7 @@ finally: hresult = SCardReleaseContext( hcontext ) if hresult!=SCARD_S_SUCCESS: - raise 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) print 'Released context.' except: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2009-04-18 08:07:15 UTC (rev 283) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getATR.py 2009-06-08 13:28:49 UTC (rev 284) @@ -30,15 +30,15 @@ try: hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if hresult!=0: - raise 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) print 'Context established!' try: hresult, readers = SCardListReaders( hcontext, [] ) if hresult!=0: - raise 'Failed to list readers: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to list readers: ' + SCardGetErrorMessage(hresult) if len(readers)<1: - raise 'No smart card readers' + raise Exception('No smart card readers') print 'PCSC Readers:', readers for reader in readers: @@ -71,7 +71,7 @@ finally: hresult = SCardReleaseContext( hcontext ) if hresult!=0: - raise 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) print 'Released context.' except: Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2009-04-18 08:07:15 UTC (rev 283) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2009-06-08 13:28:49 UTC (rev 284) @@ -62,7 +62,7 @@ try: hresult, hcontext = SCardEstablishContext( SCARD_SCOPE_USER ) if hresult!=0: - raise 'Failed to establish context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to establish context: ' + SCardGetErrorMessage(hresult) print 'Context established!' try: @@ -111,7 +111,7 @@ finally: hresult = SCardReleaseContext( hcontext ) if hresult!=SCARD_S_SUCCESS: - raise 'Failed to release context: ' + SCardGetErrorMessage(hresult) + raise error, 'Failed to release context: ' + SCardGetErrorMessage(hresult) print 'Released context.' except: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-04-18 08:07:17
|
Revision: 283 http://pyscard.svn.sourceforge.net/pyscard/?rev=283&view=rev Author: ludov Date: 2009-04-18 08:07:15 +0000 (Sat, 18 Apr 2009) Log Message: ----------- set svn:executable Property Changed: ---------------- trunk/contrib/parseATR/parseATR.py Property changes on: trunk/contrib/parseATR/parseATR.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-03-20 16:50:36
|
Revision: 282 http://pyscard.svn.sourceforge.net/pyscard/?rev=282&view=rev Author: ludov Date: 2009-03-20 16:50:23 +0000 (Fri, 20 Mar 2009) Log Message: ----------- copy the definition of SCARD_CTL_CODE() from pcsc-lite instead of inventing a new (and different) one. Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/scard.i Modified: trunk/pyscard/src/smartcard/scard/scard.i =================================================================== --- trunk/pyscard/src/smartcard/scard/scard.i 2009-03-13 15:09:46 UTC (rev 281) +++ trunk/pyscard/src/smartcard/scard/scard.i 2009-03-20 16:50:23 UTC (rev 282) @@ -173,7 +173,7 @@ #ifdef __APPLE__ //#include <PCSC/reader.h> #ifndef SCARD_CTL_CODE - #define SCARD_CTL_CODE(x) (x) + #define SCARD_CTL_CODE(code) (0x42000000 + (code)) #endif #else #include <reader.h> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-13 14:51:26
|
Revision: 280 http://pyscard.svn.sourceforge.net/pyscard/?rev=280&view=rev Author: jdaussel Date: 2009-03-13 14:51:07 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Added HexListToBinString, BinStringToHexList, hl2bs, bs2hl Modified Paths: -------------- trunk/pyscard/src/smartcard/util/__init__.py Modified: trunk/pyscard/src/smartcard/util/__init__.py =================================================================== --- trunk/pyscard/src/smartcard/util/__init__.py 2009-03-13 14:05:52 UTC (rev 279) +++ trunk/pyscard/src/smartcard/util/__init__.py 2009-03-13 14:51:07 UTC (rev 280) @@ -209,3 +209,20 @@ pformat = "0x"+pformat return rstrip(rstrip(reduce( lambda a, b: a+pformat % ((b+256)%256), [""] + bytes )),',') +def HexListToBinString( hexlist ): + binstring="" + for byte in hexlist: + binstring= binstring + chr( eval( '0x%x' % byte ) ) + return binstring + +def BinStringToHexList( binstring ): + hexlist=[] + for byte in binstring: + hexlist= hexlist + [ ord(byte) ] + return hexlist + +def hl2bs( hexlist ): + return HexListToBinString( hexlist ) + +def bs2hl( binstring ): + return BinStringToHexList( binstring ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-13 14:06:05
|
Revision: 279 http://pyscard.svn.sourceforge.net/pyscard/?rev=279&view=rev Author: jdaussel Date: 2009-03-13 14:05:52 +0000 (Fri, 13 Mar 2009) Log Message: ----------- Added sample script for ATR utility class Added Paths: ----------- trunk/pyscard/src/smartcard/Examples/framework/sample_ATR.py Added: trunk/pyscard/src/smartcard/Examples/framework/sample_ATR.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/framework/sample_ATR.py (rev 0) +++ trunk/pyscard/src/smartcard/Examples/framework/sample_ATR.py 2009-03-13 14:05:52 UTC (rev 279) @@ -0,0 +1,39 @@ +#! /usr/bin/env python +""" +Sample script for the smartcard.ATR utility class. + +__author__ = "http://www.gemalto.com" + +Copyright 2001-2009 gemalto +Author: Jean-Daniel Aussel, mailto:jea...@ge... + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" +from smartcard.ATR import ATR +from smartcard.util import toHexString + +atr = ATR([0x3B, 0x9E, 0x95, 0x80, 0x1F, 0xC3, 0x80, 0x31, 0xA0, 0x73, + 0xBE, 0x21, 0x13, 0x67, 0x29, 0x02, 0x01, 0x01, 0x81,0xCD,0xB9] ) + +print atr +print 'historical bytes: ', toHexString( atr.getHistoricalBytes() ) +print 'checksum: ', "0x%X" % atr.getChecksum() +print 'checksum OK: ', atr.checksumOK +print 'T0 supported: ', atr.isT0Supported() +print 'T1 supported: ', atr.isT1Supported() +print 'T15 supported: ', atr.isT15Supported() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-12 16:18:48
|
Revision: 277 http://pyscard.svn.sourceforge.net/pyscard/?rev=277&view=rev Author: jdaussel Date: 2009-03-12 16:18:40 +0000 (Thu, 12 Mar 2009) Log Message: ----------- Updated release from 1.6.7 to 1.6.8 to prepare next delivery Modified Paths: -------------- trunk/pyscard/src/PKG-INFO trunk/pyscard/src/README trunk/pyscard/src/setup.py trunk/pyscard/src/smartcard/ACKS trunk/pyscard/src/smartcard/README trunk/pyscard/src/smartcard/TODO trunk/pyscard/src/smartcard/doc/framework-samples.html trunk/pyscard/src/smartcard/doc/index.html trunk/pyscard/src/smartcard/doc/scard-samples.html trunk/pyscard/src/smartcard/scard/gemalto.ver trunk/pyscard/tools/win32.commands/build.bat Modified: trunk/pyscard/src/PKG-INFO =================================================================== --- trunk/pyscard/src/PKG-INFO 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/PKG-INFO 2009-03-12 16:18:40 UTC (rev 277) @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: pyscard -Version: 1.6.7 +Version: 1.6.8 Summary: Smartcard module for Python. Home-page: http://pyscard.sourceforge.net/ Author: Jean-Daniel Aussel @@ -11,7 +11,7 @@ Platform: linux Platform: win32 Platform: Mac OSX -Classifier: Development Status :: 1.6.7 - Release +Classifier: Development Status :: 1.6.8 - Release Classifier: License :: GNU LESSER GENERAL PUBLIC LICENSE Classifier: Intended Audience :: Developers Classifier: Operating System :: Unix Modified: trunk/pyscard/src/README =================================================================== --- trunk/pyscard/src/README 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/README 2009-03-12 16:18:40 UTC (rev 277) @@ -4,7 +4,7 @@ http://pyscard.sourceforge.net/ ------------------------------------------------------------------------------- -Copyright 2001-2008 gemalto +Copyright 2001-2009 gemalto Author: Jean-Daniel Aussel, mailto:jea...@ge... This file is part of pyscard. @@ -23,7 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- -Last update : pyscard 1.6.7 (September 2008) +Last update : pyscard 1.6.8 (March 2009) ------------------------------------------------------------------------------- pyscard is a python module adding smart cards support to python. @@ -61,7 +61,7 @@ The binary msi installer and self-executable installer are packaged for a specific version of python, and have name similar to -pyscard-1.6.7.win32-py2.5.msi and pyscard-1.6.7.win32-py2.5.exe for +pyscard-1.6.8.win32-py2.5.msi and pyscard-1.6.8.win32-py2.5.exe for python 2.5. @@ -77,8 +77,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip for windows, -and pyscard-1.6.7.tar.gz for linux. +The source distribution is available as pyscard-1.6.8.zip for windows, +and pyscard-1.6.8.tar.gz for linux. 3. unzip the source distribution, open a console and type the following: @@ -99,8 +99,8 @@ 1. download the binary distribution The binary distribution is either an archive file or a rpm file, with -names similar to pyscard-1.6.7-1.i386.rpm for the rpm distribution, -or pyscard-1.6.7.linux-i686.tar.gz for the archive distribution. +names similar to pyscard-1.6.8-1.i386.rpm for the rpm distribution, +or pyscard-1.6.8.linux-i686.tar.gz for the archive distribution. 2. untar the binary distribution @@ -115,8 +115,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar the source distribution @@ -130,7 +130,7 @@ Installation on Max OS X Tiger: -------------------------------- -The Mac OS X Tiger support is experimental on pyscard 1.6.7. It was developed +The Mac OS X Tiger support is experimental on pyscard 1.6.8. It was developed and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a ppc MacBook. @@ -140,14 +140,14 @@ 1. download the binary distribution The binary distribution is an archive file, with a name similar to -pyscard-1.6.7-py-2.3-macosx10.4.mpkg or pyscard-1.6.7-py-2.5-macosx10.4.mpkg. +pyscard-1.6.8-py-2.3-macosx10.4.mpkg or pyscard-1.6.8-py-2.5-macosx10.4.mpkg. 2. Open the package and proceed with installation. -Python 2.3 is pre-installed, so install pyscard-1.6.7-py-2.3-macosx10.4.mpkg if +Python 2.3 is pre-installed, so install pyscard-1.6.8-py-2.3-macosx10.4.mpkg if you did not install another release of python. -Install pyscard-1.6.7-py-2.5-macosx10.4.mpkg if you installed python 2.5. +Install pyscard-1.6.8-py-2.5-macosx10.4.mpkg if you installed python 2.5. Installing on Mac OS X Tiger from the source distribution ---------------------------------------------------------- @@ -157,8 +157,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar or unzip the source distribution @@ -173,7 +173,7 @@ Installation on Max OS X Leopard: --------------------------------- -The Mac OS X Leopard support is experimental on pyscard 1.6.7. It was developed +The Mac OS X Leopard support is experimental on pyscard 1.6.8. It was developed and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a ppc MacBook. @@ -183,7 +183,7 @@ 1. download the binary distribution The binary distribution is an archive file, with a name similar to -pyscard-1.6.7-py-2.5-macosx10.5.mpkg. +pyscard-1.6.8-py-2.5-macosx10.5.mpkg. 2. Open the package and proceed with installation. @@ -195,8 +195,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar or unzip the source distribution @@ -235,9 +235,9 @@ setup.py build_ext bdist_wininst This will build the msi installer and self-executable installer in the dist -directory, with names similar to pyscard-1.6.7.win32-py2.5.msi and -pyscard-1.6.7.win32-py2.5.exe for python 2.5, and -pyscard-1.6.7.win32-py2.4.msi and pyscard-1.6.7.win32-py2.4.exe for +directory, with names similar to pyscard-1.6.8.win32-py2.5.msi and +pyscard-1.6.8.win32-py2.5.exe for python 2.5, and +pyscard-1.6.8.win32-py2.4.msi and pyscard-1.6.8.win32-py2.4.exe for python 2.4. Building a binary distribution for linux @@ -252,7 +252,7 @@ /usr/bin/python setup.py build_ext bdist -This will build a package similar to pyscard-1.6.7.linux-i686.tar.gz +This will build a package similar to pyscard-1.6.8.linux-i686.tar.gz containing a tree Building a rpm distribution for linux @@ -274,7 +274,7 @@ echo "%_unpackaged_files_terminate_build 0" >> /etc/rpm/macros This will build in the dist directory a binary distribution with a name -similar to pyscard-1.6.7-1.i386.rpm. +similar to pyscard-1.6.8-1.i386.rpm. Building a binary distribution for Mac OS X Tiger ------------------------------------------------- @@ -291,7 +291,7 @@ python setup.py build_ext /System/Library/Frameworks/Python.Framework/Versions/2.3/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.3-macosx10.4.mpkg. +This will build package pyscard-1.6.8-py-2.3-macosx10.4.mpkg. If you are using python 2.5, in the root directory of the source distribution, i.e. in the src directory, execute the following commands in a terminal: @@ -299,7 +299,7 @@ python setup.py build_ext /Library/Frameworks/Python.Framework/Versions/2.5/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.6-macosx10.4.mpkg. +This will build package pyscard-1.6.8-py-2.6-macosx10.4.mpkg. Building a binary distribution for Mac OS X Leopard @@ -319,7 +319,7 @@ python setup.py build_ext /Library/Frameworks/Python.Framework/Versions/2.5/Extras/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.5-macosx10.5.mpkg. +This will build package pyscard-1.6.8-py-2.5-macosx10.5.mpkg. ------------------------------------------------------------------------------- Modified: trunk/pyscard/src/setup.py =================================================================== --- trunk/pyscard/src/setup.py 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/setup.py 2009-03-12 16:18:40 UTC (rev 277) @@ -135,7 +135,7 @@ build_ext.swig_sources = swig_sources kw = {'name':"pyscard", - 'version':"1.6.7", + 'version':"1.6.8", 'description':"Smartcard module for Python.", 'author':"Jean-Daniel Aussel", 'author_email':"aus...@ge...", @@ -181,7 +181,7 @@ if hasattr(core, 'setup_keywords'): if 'classifiers' in core.setup_keywords: kw['classifiers'] = [ - 'Development Status :: 1.6.7 - Release', + 'Development Status :: 1.6.8 - Release', 'License :: GNU LESSER GENERAL PUBLIC LICENSE', 'Intended Audience :: Developers', 'Operating System :: Unix', Modified: trunk/pyscard/src/smartcard/ACKS =================================================================== --- trunk/pyscard/src/smartcard/ACKS 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/ACKS 2009-03-12 16:18:40 UTC (rev 277) @@ -19,4 +19,6 @@ Henryk Plotz Michael Roehner Ludovic Rousseau +David Wagner + Modified: trunk/pyscard/src/smartcard/README =================================================================== --- trunk/pyscard/src/smartcard/README 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/README 2009-03-12 16:18:40 UTC (rev 277) @@ -4,7 +4,7 @@ http://pyscard.sourceforge.net/ ------------------------------------------------------------------------------- -Copyright 2001-2008 gemalto +Copyright 2001-2009 gemalto Author: Jean-Daniel Aussel, mailto:jea...@ge... This file is part of pyscard. @@ -23,7 +23,7 @@ Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ------------------------------------------------------------------------------- -Last update : pyscard 1.6.7 (September 2008) +Last update : pyscard 1.6.8 (March 2009) ------------------------------------------------------------------------------- pyscard is a python module adding smart cards support to python. @@ -61,7 +61,7 @@ The binary msi installer and self-executable installer are packaged for a specific version of python, and have name similar to -pyscard-1.6.7.win32-py2.5.msi and pyscard-1.6.7.win32-py2.5.exe for +pyscard-1.6.8.win32-py2.5.msi and pyscard-1.6.8.win32-py2.5.exe for python 2.5. @@ -77,8 +77,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip for windows, -and pyscard-1.6.7.tar.gz for linux. +The source distribution is available as pyscard-1.6.8.zip for windows, +and pyscard-1.6.8.tar.gz for linux. 3. unzip the source distribution, open a console and type the following: @@ -99,8 +99,8 @@ 1. download the binary distribution The binary distribution is either an archive file or a rpm file, with -names similar to pyscard-1.6.7-1.i386.rpm for the rpm distribution, -or pyscard-1.6.7.linux-i686.tar.gz for the archive distribution. +names similar to pyscard-1.6.8-1.i386.rpm for the rpm distribution, +or pyscard-1.6.8.linux-i686.tar.gz for the archive distribution. 2. untar the binary distribution @@ -115,8 +115,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar the source distribution @@ -130,7 +130,7 @@ Installation on Max OS X Tiger: -------------------------------- -The Mac OS X Tiger support is experimental on pyscard 1.6.7. It was developed +The Mac OS X Tiger support is experimental on pyscard 1.6.8. It was developed and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a ppc MacBook. @@ -140,14 +140,14 @@ 1. download the binary distribution The binary distribution is an archive file, with a name similar to -pyscard-1.6.7-py-2.3-macosx10.4.mpkg or pyscard-1.6.7-py-2.5-macosx10.4.mpkg. +pyscard-1.6.8-py-2.3-macosx10.4.mpkg or pyscard-1.6.8-py-2.5-macosx10.4.mpkg. 2. Open the package and proceed with installation. -Python 2.3 is pre-installed, so install pyscard-1.6.7-py-2.3-macosx10.4.mpkg if +Python 2.3 is pre-installed, so install pyscard-1.6.8-py-2.3-macosx10.4.mpkg if you did not install another release of python. -Install pyscard-1.6.7-py-2.5-macosx10.4.mpkg if you installed python 2.5. +Install pyscard-1.6.8-py-2.5-macosx10.4.mpkg if you installed python 2.5. Installing on Mac OS X Tiger from the source distribution ---------------------------------------------------------- @@ -157,8 +157,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar or unzip the source distribution @@ -173,7 +173,7 @@ Installation on Max OS X Leopard: --------------------------------- -The Mac OS X Leopard support is experimental on pyscard 1.6.7. It was developed +The Mac OS X Leopard support is experimental on pyscard 1.6.8. It was developed and tested on a i386 MacBook Pro. Please drop me a mail if you succeed on a ppc MacBook. @@ -183,7 +183,7 @@ 1. download the binary distribution The binary distribution is an archive file, with a name similar to -pyscard-1.6.7-py-2.5-macosx10.5.mpkg. +pyscard-1.6.8-py-2.5-macosx10.5.mpkg. 2. Open the package and proceed with installation. @@ -195,8 +195,8 @@ 2. download the source distribution -The source distribution is available as pyscard-1.6.7.zip or -pyscard-1.6.7.tar.gz. +The source distribution is available as pyscard-1.6.8.zip or +pyscard-1.6.8.tar.gz. 3. untar or unzip the source distribution @@ -235,9 +235,9 @@ setup.py build_ext bdist_wininst This will build the msi installer and self-executable installer in the dist -directory, with names similar to pyscard-1.6.7.win32-py2.5.msi and -pyscard-1.6.7.win32-py2.5.exe for python 2.5, and -pyscard-1.6.7.win32-py2.4.msi and pyscard-1.6.7.win32-py2.4.exe for +directory, with names similar to pyscard-1.6.8.win32-py2.5.msi and +pyscard-1.6.8.win32-py2.5.exe for python 2.5, and +pyscard-1.6.8.win32-py2.4.msi and pyscard-1.6.8.win32-py2.4.exe for python 2.4. Building a binary distribution for linux @@ -252,7 +252,7 @@ /usr/bin/python setup.py build_ext bdist -This will build a package similar to pyscard-1.6.7.linux-i686.tar.gz +This will build a package similar to pyscard-1.6.8.linux-i686.tar.gz containing a tree Building a rpm distribution for linux @@ -274,7 +274,7 @@ echo "%_unpackaged_files_terminate_build 0" >> /etc/rpm/macros This will build in the dist directory a binary distribution with a name -similar to pyscard-1.6.7-1.i386.rpm. +similar to pyscard-1.6.8-1.i386.rpm. Building a binary distribution for Mac OS X Tiger ------------------------------------------------- @@ -291,7 +291,7 @@ python setup.py build_ext /System/Library/Frameworks/Python.Framework/Versions/2.3/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.3-macosx10.4.mpkg. +This will build package pyscard-1.6.8-py-2.3-macosx10.4.mpkg. If you are using python 2.5, in the root directory of the source distribution, i.e. in the src directory, execute the following commands in a terminal: @@ -299,7 +299,7 @@ python setup.py build_ext /Library/Frameworks/Python.Framework/Versions/2.5/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.6-macosx10.4.mpkg. +This will build package pyscard-1.6.8-py-2.6-macosx10.4.mpkg. Building a binary distribution for Mac OS X Leopard @@ -319,7 +319,7 @@ python setup.py build_ext /Library/Frameworks/Python.Framework/Versions/2.5/Extras/bin/bdist_mpkg setup.py -This will build package pyscard-1.6.7-py-2.5-macosx10.5.mpkg. +This will build package pyscard-1.6.8-py-2.5-macosx10.5.mpkg. ------------------------------------------------------------------------------- Modified: trunk/pyscard/src/smartcard/TODO =================================================================== --- trunk/pyscard/src/smartcard/TODO 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/TODO 2009-03-12 16:18:40 UTC (rev 277) @@ -8,4 +8,4 @@ - more unit tests -September 2008 +March 2009 Modified: trunk/pyscard/src/smartcard/doc/framework-samples.html =================================================================== --- trunk/pyscard/src/smartcard/doc/framework-samples.html 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/doc/framework-samples.html 2009-03-12 16:18:40 UTC (rev 277) @@ -9,7 +9,7 @@ <a href="http://sourceforge.net"></a><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=196342&type=3" width="125" height="37" border="0" align="right" alt="SourceForge.net Logo" /></a> <hr> <H1 align="center"> </h1> -Last update : pyscard 1.6.7 (September 2008) +Last update : pyscard 1.6.8 (March 2009) <p> <a href="pyscard-usersguide.html">pyscard</a> is a python module adding smart cards support to <a href="http://www.python.org">python</a>. <p>It consists of <a Modified: trunk/pyscard/src/smartcard/doc/index.html =================================================================== --- trunk/pyscard/src/smartcard/doc/index.html 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/doc/index.html 2009-03-12 16:18:40 UTC (rev 277) @@ -8,7 +8,7 @@ <body bgcolor="#ffffff"> <H1 align="center">pyscard<a href="http://sourceforge.net"></a><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=196342&type=3" width="125" height="37" border="0" align="right" alt="SourceForge.net Logo" /></a></h1> <hr> -Last update : pyscard 1.6.7 (September 2008) +Last update : pyscard 1.6.8 (March 2009) <p> <a href="pyscard-usersguide.html">pyscard - python smart card library</a> is a python module adding smart cards support to <a href="http://www.python.org">python.</a> Modified: trunk/pyscard/src/smartcard/doc/scard-samples.html =================================================================== --- trunk/pyscard/src/smartcard/doc/scard-samples.html 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/doc/scard-samples.html 2009-03-12 16:18:40 UTC (rev 277) @@ -9,7 +9,7 @@ <a href="http://sourceforge.net"></a><a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=196342&type=3" width="125" height="37" border="0" align="right" alt="SourceForge.net Logo" /></a> <hr> <H1 align="center"> </h1> -Last update : pyscard 1.6.7 (September 2008) +Last update : pyscard 1.6.8 (March 2009) <p>Using the <a href="epydoc/index.html">smartcard framework</a> is the preferred way to write python smart card application. You can however use the <a href="epydoc/smartcard.scard.scard-module.html">smartcard.scard</a> library to write your python smart card application if you want to write your Modified: trunk/pyscard/src/smartcard/scard/gemalto.ver =================================================================== --- trunk/pyscard/src/smartcard/scard/gemalto.ver 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/src/smartcard/scard/gemalto.ver 2009-03-12 16:18:40 UTC (rev 277) @@ -4,7 +4,7 @@ #ifndef VER_LEGALCOPYRIGHT_YEARS -#define VER_LEGALCOPYRIGHT_YEARS "2001-2008" +#define VER_LEGALCOPYRIGHT_YEARS "2001-2009" #endif #ifndef VER_LEGALCOPYRIGHT_STR @@ -16,7 +16,7 @@ #endif #ifndef VER_PRODUCTVERSION -#define VER_PRODUCTVERSION 1,06,06,0002 +#define VER_PRODUCTVERSION 1,06,08,0010 #endif #ifndef VER_FILEVERSION @@ -24,7 +24,7 @@ #endif #ifndef VER_PRODUCTVERSION_STR -#define VER_PRODUCTVERSION_STR "1.6.7" +#define VER_PRODUCTVERSION_STR "1.6.8" #endif #ifndef VER_FILEFLAGSMASK Modified: trunk/pyscard/tools/win32.commands/build.bat =================================================================== --- trunk/pyscard/tools/win32.commands/build.bat 2009-03-12 16:12:24 UTC (rev 276) +++ trunk/pyscard/tools/win32.commands/build.bat 2009-03-12 16:18:40 UTC (rev 277) @@ -1,4 +1,4 @@ -pushd %~dp0..\..\src -setup.py build_ext bdist bdist bdist_msi bdist_wininst sdist -popd - +pushd %~dp0..\..\src +setup.py build_ext bdist bdist bdist_msi bdist_wininst sdist +popd + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-12 16:12:40
|
Revision: 276 http://pyscard.svn.sourceforge.net/pyscard/?rev=276&view=rev Author: jdaussel Date: 2009-03-12 16:12:24 +0000 (Thu, 12 Mar 2009) Log Message: ----------- Started change log for 1.6.8 Modified Paths: -------------- trunk/pyscard/src/smartcard/ChangeLog Modified: trunk/pyscard/src/smartcard/ChangeLog =================================================================== --- trunk/pyscard/src/smartcard/ChangeLog 2009-03-12 10:27:10 UTC (rev 275) +++ trunk/pyscard/src/smartcard/ChangeLog 2009-03-12 16:12:24 UTC (rev 276) @@ -1,3 +1,15 @@ +1.6.8 +===== + * fixed SCARD_ERROR types to match correct types on linux and Mac OS X (Ludovic Rousseau) + * store g_rgSCard* references as void* (Ludovic Rousseau) + * modified Mac OS X build to locate PCSC headers using -framework option (Ludovic Rousseau) + * added contrib root directory and parseATR as first contribution (Ludovic Rousseau) + * updated a few samples to support SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 instead of just SCARD_PROTOCOL_T0 (Ludovic Rousseau) + * added SCARD_E_NO_READERS_AVAILABLE definition (Ludovic Rousseau) + * added simpleAPDU.py, a simple script to send a couple of APDUs (Ludovic Rousseau) + * added support for Snow Leopard 10.6 (Ludovic Rousseau) + * redefined error codes to be non-Windows or -linux specifics (Ludovic Rousseau) + 1.6.7 ===== * better thread support and clean-up in ReaderMonitoringThread (Frank Aune) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-12 10:27:24
|
Revision: 275 http://pyscard.svn.sourceforge.net/pyscard/?rev=275&view=rev Author: jdaussel Date: 2009-03-12 10:27:10 +0000 (Thu, 12 Mar 2009) Log Message: ----------- myg_prgScard* are now void*, fix cast for GetProcAddress on windows Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/winscarddll.c Modified: trunk/pyscard/src/smartcard/scard/winscarddll.c =================================================================== --- trunk/pyscard/src/smartcard/scard/winscarddll.c 2009-03-12 10:18:48 UTC (rev 274) +++ trunk/pyscard/src/smartcard/scard/winscarddll.c 2009-03-12 10:27:10 UTC (rev 275) @@ -645,9 +645,9 @@ GETPROCADDRESS( SCARDTRANSMIT , SCardTransmit ); - myg_prgSCardT0Pci = (unsigned long)GetProcAddress( hinstDLL, "g_rgSCardT0Pci" ); - myg_prgSCardT1Pci = (unsigned long)GetProcAddress( hinstDLL, "g_rgSCardT1Pci" ); - myg_prgSCardRawPci = (unsigned long)GetProcAddress( hinstDLL, "g_rgSCardRawPci" ); + myg_prgSCardT0Pci = GetProcAddress( hinstDLL, "g_rgSCardT0Pci" ); + myg_prgSCardT1Pci = GetProcAddress( hinstDLL, "g_rgSCardT1Pci" ); + myg_prgSCardRawPci = GetProcAddress( hinstDLL, "g_rgSCardRawPci" ); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-12 10:19:01
|
Revision: 274 http://pyscard.svn.sourceforge.net/pyscard/?rev=274&view=rev Author: jdaussel Date: 2009-03-12 10:18:48 +0000 (Thu, 12 Mar 2009) Log Message: ----------- PCSCSTRINGIFYERROR on pcsclite only Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/winscarddll.c trunk/pyscard/src/smartcard/scard/winscarddll.h Modified: trunk/pyscard/src/smartcard/scard/winscarddll.c =================================================================== --- trunk/pyscard/src/smartcard/scard/winscarddll.c 2009-03-12 10:13:41 UTC (rev 273) +++ trunk/pyscard/src/smartcard/scard/winscarddll.c 2009-03-12 10:18:48 UTC (rev 274) @@ -580,7 +580,11 @@ SCARDRELEASECONTEXT mySCardReleaseContext = _defaultSCARDRELEASECONTEXT; SCARDSTATUSA mySCardStatusA = _defaultSCARDSTATUSA; SCARDTRANSMIT mySCardTransmit = _defaultSCARDTRANSMIT; + + +#ifdef PCSCLITE PCSCSTRINGIFYERROR myPcscStringifyError = _defaultPCSCSTRINGIFYERROR; +#endif // PCSCLITE void * myg_prgSCardT0Pci=NULL; Modified: trunk/pyscard/src/smartcard/scard/winscarddll.h =================================================================== --- trunk/pyscard/src/smartcard/scard/winscarddll.h 2009-03-12 10:13:41 UTC (rev 273) +++ trunk/pyscard/src/smartcard/scard/winscarddll.h 2009-03-12 10:18:48 UTC (rev 274) @@ -52,34 +52,34 @@ #endif #endif // PCSCLITE -// +// // these functions are only available on win32 PCSC -// +// #ifdef WIN32 typedef WINSCARDAPI HANDLE (WINAPI *SCARDACCESSSTARTEDEVENT)(void); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDADDREADERTOGROUPA)( IN SCARDCONTEXT hContext, IN LPCTSTR szReaderName, IN LPCTSTR szGroupName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDFORGETCARDTYPEA)( IN SCARDCONTEXT hContext, IN LPCSTR szCardName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDFORGETREADERA)( IN SCARDCONTEXT hContext, IN LPCSTR szReaderName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDFORGETREADERGROUPA)( IN SCARDCONTEXT hContext, IN LPCSTR szGroupName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDGETCARDTYPEPROVIDERNAMEA)( IN SCARDCONTEXT hContext, @@ -87,13 +87,13 @@ IN SCARDDWORDARG dwProviderId, OUT LPTSTR szProvider, IN OUT SCARDDWORDARG* pcchProvider); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDGETPROVIDERIDA)( IN SCARDCONTEXT hContext, IN LPCSTR szCard, OUT LPGUID pguidProviderId); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDINTRODUCECARDTYPEA)( IN SCARDCONTEXT hContext, @@ -104,18 +104,18 @@ IN LPCBYTE pbAtr, IN LPCBYTE pbAtrMask, IN SCARDDWORDARG cbAtrLen); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDINTRODUCEREADERA)( IN SCARDCONTEXT hContext, IN LPCSTR szReaderName, IN LPCSTR szDeviceName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDINTRODUCEREADERGROUPA)( IN SCARDCONTEXT hContext, IN LPCSTR szGroupName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDLISTCARDSA)( IN SCARDCONTEXT hContext, @@ -124,21 +124,21 @@ IN SCARDDWORDARG cguidInterfaceCount, OUT LPTSTR mszCards, IN OUT SCARDDWORDARG* pcchCards); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDLISTINTERFACESA)( IN SCARDCONTEXT hContext, IN LPCSTR szCard, OUT LPGUID pguidInterfaces, IN OUT SCARDDWORDARG* pcguidInterfaces); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDLOCATECARDSA)( IN SCARDCONTEXT hContext, IN LPCSTR mszCards, IN OUT LPSCARD_READERSTATEA rgReaderStates, IN SCARDDWORDARG cReaders); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDLOCATECARDSBYATRA)( IN SCARDCONTEXT hContext, @@ -146,23 +146,23 @@ IN SCARDDWORDARG cAtrs, IN OUT LPSCARD_READERSTATEA rgReaderStates, IN SCARDDWORDARG cReaders); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDSETCARDTYPEPROVIDERNAMEA)( IN SCARDCONTEXT hContext, IN LPCSTR szCardName, IN SCARDDWORDARG dwProviderId, IN LPCSTR szProvider); - + typedef WINSCARDAPI void (WINAPI *SCARDRELEASESTARTEDEVENT)(void); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDREMOVEREADERFROMGROUPA)( IN SCARDCONTEXT hContext, IN LPCTSTR szReaderName, IN LPCTSTR szGroupName); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDSTATE)( IN SCARDHANDLE hCard, @@ -189,7 +189,7 @@ extern SCARDREMOVEREADERFROMGROUPA mySCardRemoveReaderFromGroupA; extern SCARDSETCARDTYPEPROVIDERNAMEA mySCardSetCardTypeProviderNameA; extern SCARDSTATE mySCardState; - + #endif // WIN32 @@ -207,7 +207,7 @@ IN SCARDDWORDARG dwAttrId, OUT LPBYTE pbAttr, IN OUT SCARDDWORDARG* pcbAttrLen); - + typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDSETATTRIB)( IN SCARDHANDLE hCard, @@ -223,7 +223,7 @@ // // SCardControl does not have the same prototype on Mac OS X Tiger -// +// #ifdef __TIGER__ typedef WINSCARDAPI SCARDRETCODE (WINAPI *SCARDCONTROL)( @@ -344,10 +344,10 @@ #ifdef PCSCLITE typedef WINSCARDAPI char* (WINAPI *PCSCSTRINGIFYERROR)( - IN SCARDRETCODE pcscError); + IN SCARDRETCODE pcscError); extern PCSCSTRINGIFYERROR myPcscStringifyError; -#endif +#endif // PCSCLITE extern SCARDBEGINTRANSACTION mySCardBeginTransaction; extern SCARDCANCEL mySCardCancel; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jda...@us...> - 2009-03-12 10:13:59
|
Revision: 273 http://pyscard.svn.sourceforge.net/pyscard/?rev=273&view=rev Author: jdaussel Date: 2009-03-12 10:13:41 +0000 (Thu, 12 Mar 2009) Log Message: ----------- Use SCARD_ATR_LENGTH instead o MAX_ATR_SIZE not defined on windows Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/helpers.c Modified: trunk/pyscard/src/smartcard/scard/helpers.c =================================================================== --- trunk/pyscard/src/smartcard/scard/helpers.c 2009-03-01 16:42:08 UTC (rev 272) +++ trunk/pyscard/src/smartcard/scard/helpers.c 2009-03-12 10:13:41 UTC (rev 273) @@ -498,9 +498,9 @@ PyObject* ot = PyTuple_New( 3 ); oReader = PyString_FromString( source->ars[i].szReader ); oEventState = PyInt_FromLong( (SCARDDWORDARG)source->ars[i].dwEventState ); - // ATR visibly not initialised - if ( source->ars[i].cbAtr > MAX_ATR_SIZE) - source->ars[i].cbAtr = 0; + // ATR visibly not initialised + if ( source->ars[i].cbAtr > SCARD_ATR_LENGTH) + source->ars[i].cbAtr = 0; oAtr = PyList_New( source->ars[i].cbAtr ); for(j=0; j<source->ars[i].cbAtr; j++) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-03-01 16:42:10
|
Revision: 272 http://pyscard.svn.sourceforge.net/pyscard/?rev=272&view=rev Author: ludov Date: 2009-03-01 16:42:08 +0000 (Sun, 01 Mar 2009) Log Message: ----------- return codes should not be Windows or Unix specific. They should be defined (even if never returned) everywhere to provide code portability Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/PcscDefs.i Modified: trunk/pyscard/src/smartcard/scard/PcscDefs.i =================================================================== --- trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-03-01 16:39:27 UTC (rev 271) +++ trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-03-01 16:42:08 UTC (rev 272) @@ -180,30 +180,6 @@ typedef enum { - SCARD_E_UNEXPECTED , - SCARD_E_ICC_INSTALLATION , - SCARD_E_ICC_CREATEORDER , - SCARD_E_DIR_NOT_FOUND , - SCARD_E_FILE_NOT_FOUND , - SCARD_E_NO_DIR , - SCARD_E_NO_FILE , - SCARD_E_NO_ACCESS , - SCARD_E_WRITE_TOO_MANY , - SCARD_E_BAD_SEEK , - SCARD_E_INVALID_CHV , - SCARD_E_UNKNOWN_RES_MNG , - SCARD_E_NO_SUCH_CERTIFICATE , - SCARD_E_CERTIFICATE_UNAVAILABLE , - SCARD_E_NO_READERS_AVAILABLE , - SCARD_E_COMM_DATA_LOST , - SCARD_E_NO_KEY_CONTAINER , - SCARD_E_SERVER_TOO_BUSY , - SCARD_W_SECURITY_VIOLATION , - SCARD_W_WRONG_CHV , - SCARD_W_CHV_BLOCKED , - SCARD_W_EOF , - SCARD_W_CANCELLED_BY_USER , - SCARD_W_CARD_NOT_AUTHENTICATED , // from winerror.h ERROR_ALREADY_EXISTS } ErrorTypeWin32Only; @@ -307,15 +283,66 @@ #ifdef SCARD_E_NO_READERS_AVAILABLE %constant TYPE SCARD_E_NO_READERS_AVAILABLE = SCARD_E_NO_READERS_AVAILABLE ; #else -%constant TYPE SCARD_E_NO_READERS_AVAILABLE = 0x80100017 ; +%constant TYPE SCARD_E_NO_READERS_AVAILABLE = 0x8010002E ; #endif %constant TYPE SCARD_E_UNSUPPORTED_FEATURE = SCARD_E_UNSUPPORTED_FEATURE ; %constant TYPE SCARD_W_UNSUPPORTED_CARD = SCARD_W_UNSUPPORTED_CARD ; %constant TYPE SCARD_W_UNRESPONSIVE_CARD = SCARD_W_UNRESPONSIVE_CARD ; %constant TYPE SCARD_W_UNPOWERED_CARD = SCARD_W_UNPOWERED_CARD ; %constant TYPE SCARD_W_RESET_CARD = SCARD_W_RESET_CARD ; -%constant TYPE SCARD_W_REMOVED_CARD = SCARD_W_REMOVED_CARD ; +%constant TYPE SCARD_W_REMOVED_CARD = SCARD_W_REMOVED_CARD ; +#ifdef SCARD_W_SECURITY_VIOLATION +/* introduced in pcsc-lite > 1.5.2 */ +%constant TYPE SCARD_W_SECURITY_VIOLATION = SCARD_W_SECURITY_VIOLATION ; +%constant TYPE SCARD_W_WRONG_CHV = SCARD_W_WRONG_CHV ; +%constant TYPE SCARD_W_CHV_BLOCKED = SCARD_W_CHV_BLOCKED ; +%constant TYPE SCARD_W_EOF = SCARD_W_EOF ; +%constant TYPE SCARD_W_CANCELLED_BY_USER = SCARD_W_CANCELLED_BY_USER ; +%constant TYPE SCARD_W_CARD_NOT_AUTHENTICATED = SCARD_W_CARD_NOT_AUTHENTICATED ; +%constant TYPE SCARD_E_UNEXPECTED = SCARD_E_UNEXPECTED ; +%constant TYPE SCARD_E_ICC_INSTALLATION = SCARD_E_ICC_INSTALLATION ; +%constant TYPE SCARD_E_ICC_CREATEORDER = SCARD_E_ICC_CREATEORDER ; +%constant TYPE SCARD_E_DIR_NOT_FOUND = SCARD_E_DIR_NOT_FOUND ; +%constant TYPE SCARD_E_FILE_NOT_FOUND = SCARD_E_FILE_NOT_FOUND ; +%constant TYPE SCARD_E_NO_DIR = SCARD_E_NO_DIR ; +%constant TYPE SCARD_E_NO_FILE = SCARD_E_NO_FILE ; +%constant TYPE SCARD_E_NO_ACCESS = SCARD_E_NO_ACCESS ; +%constant TYPE SCARD_E_WRITE_TOO_MANY = SCARD_E_WRITE_TOO_MANY ; +%constant TYPE SCARD_E_BAD_SEEK = SCARD_E_BAD_SEEK ; +%constant TYPE SCARD_E_INVALID_CHV = SCARD_E_INVALID_CHV ; +%constant TYPE SCARD_E_UNKNOWN_RES_MNG = SCARD_E_UNKNOWN_RES_MNG ; +%constant TYPE SCARD_E_NO_SUCH_CERTIFICATE = SCARD_E_NO_SUCH_CERTIFICATE ; +%constant TYPE SCARD_E_CERTIFICATE_UNAVAILABLE = SCARD_E_CERTIFICATE_UNAVAILABLE ; +%constant TYPE SCARD_E_COMM_DATA_LOST = SCARD_E_COMM_DATA_LOST ; +%constant TYPE SCARD_E_NO_KEY_CONTAINER = SCARD_E_NO_KEY_CONTAINER ; +%constant TYPE SCARD_E_SERVER_TOO_BUSY = SCARD_E_SERVER_TOO_BUSY ; +#else +%constant TYPE SCARD_W_SECURITY_VIOLATION = 0x8010006A ; +%constant TYPE SCARD_W_WRONG_CHV = 0x8010006B ; +%constant TYPE SCARD_W_CHV_BLOCKED = 0x8010006C ; +%constant TYPE SCARD_W_EOF = 0x8010006D ; +%constant TYPE SCARD_W_CANCELLED_BY_USER = 0x8010006E ; +%constant TYPE SCARD_W_CARD_NOT_AUTHENTICATED = 0x8010006F ; +%constant TYPE SCARD_E_UNEXPECTED = 0x8010001F ; +%constant TYPE SCARD_E_ICC_INSTALLATION = 0x80100020 ; +%constant TYPE SCARD_E_ICC_CREATEORDER = 0x80100021 ; +%constant TYPE SCARD_E_DIR_NOT_FOUND = 0x80100023 ; +%constant TYPE SCARD_E_FILE_NOT_FOUND = 0x80100024 ; +%constant TYPE SCARD_E_NO_DIR = 0x80100025 ; +%constant TYPE SCARD_E_NO_FILE = 0x80100026 ; +%constant TYPE SCARD_E_NO_ACCESS = 0x80100027 ; +%constant TYPE SCARD_E_WRITE_TOO_MANY = 0x80100028 ; +%constant TYPE SCARD_E_BAD_SEEK = 0x80100029 ; +%constant TYPE SCARD_E_INVALID_CHV = 0x8010002A ; +%constant TYPE SCARD_E_UNKNOWN_RES_MNG = 0x8010002B ; +%constant TYPE SCARD_E_NO_SUCH_CERTIFICATE = 0x8010002C ; +%constant TYPE SCARD_E_CERTIFICATE_UNAVAILABLE = 0x8010002D ; +%constant TYPE SCARD_E_COMM_DATA_LOST = 0x8010002F ; +%constant TYPE SCARD_E_NO_KEY_CONTAINER = 0x80100030 ; +%constant TYPE SCARD_E_SERVER_TOO_BUSY = 0x80100031 ; +#endif + #ifdef WIN32 typedef enum { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-03-01 16:39:33
|
Revision: 271 http://pyscard.svn.sourceforge.net/pyscard/?rev=271&view=rev Author: ludov Date: 2009-03-01 16:39:27 +0000 (Sun, 01 Mar 2009) Log Message: ----------- check that all return codes are defined as a symbol Modified Paths: -------------- trunk/pyscard/src/smartcard/test/scard/testsuite_scard.py Added Paths: ----------- trunk/pyscard/src/smartcard/test/scard/testcase_returncodes.py Added: trunk/pyscard/src/smartcard/test/scard/testcase_returncodes.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testcase_returncodes.py (rev 0) +++ trunk/pyscard/src/smartcard/test/scard/testcase_returncodes.py 2009-03-01 16:39:27 UTC (rev 271) @@ -0,0 +1,110 @@ +#! /usr/bin/env python +"""Unit tests for return codes + +This test case can be executed individually, or with all other test cases +thru testsuite_scard.py. + +__author__ = "http://www.gemalto.com" + +Copyright 2009 gemalto +Author: Ludovic Rousseau, mailto:lud...@fr... + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" + + +import unittest +from smartcard.scard import * +import sys + + +class testcase_returncodes(unittest.TestCase): + """Test scard API for return codes """ + def test_getReturnCodes(self): + errors = ( + SCARD_S_SUCCESS , + SCARD_F_INTERNAL_ERROR , + SCARD_E_CANCELLED , + SCARD_E_INVALID_HANDLE , + SCARD_E_INVALID_PARAMETER , + SCARD_E_INVALID_TARGET , + SCARD_E_NO_MEMORY , + SCARD_F_WAITED_TOO_LONG , + SCARD_E_INSUFFICIENT_BUFFER , + SCARD_E_UNKNOWN_READER , + SCARD_E_TIMEOUT , + SCARD_E_SHARING_VIOLATION , + SCARD_E_NO_SMARTCARD , + SCARD_E_UNKNOWN_CARD , + SCARD_E_CANT_DISPOSE , + SCARD_E_PROTO_MISMATCH , + SCARD_E_NOT_READY , + SCARD_E_INVALID_VALUE , + SCARD_E_SYSTEM_CANCELLED , + SCARD_F_COMM_ERROR , + SCARD_F_UNKNOWN_ERROR , + SCARD_E_INVALID_ATR , + SCARD_E_NOT_TRANSACTED , + SCARD_E_READER_UNAVAILABLE , + SCARD_E_PCI_TOO_SMALL , + SCARD_E_READER_UNSUPPORTED , + SCARD_E_DUPLICATE_READER , + SCARD_E_CARD_UNSUPPORTED , + SCARD_E_NO_SERVICE , + SCARD_E_SERVICE_STOPPED , + SCARD_E_UNEXPECTED , + SCARD_E_ICC_INSTALLATION , + SCARD_E_ICC_CREATEORDER , + SCARD_E_UNSUPPORTED_FEATURE , + SCARD_E_DIR_NOT_FOUND , + SCARD_E_FILE_NOT_FOUND , + SCARD_E_NO_DIR , + SCARD_E_NO_FILE , + SCARD_E_NO_ACCESS , + SCARD_E_WRITE_TOO_MANY , + SCARD_E_BAD_SEEK , + SCARD_E_INVALID_CHV , + SCARD_E_UNKNOWN_RES_MNG , + SCARD_E_NO_SUCH_CERTIFICATE , + SCARD_E_CERTIFICATE_UNAVAILABLE , + SCARD_E_NO_READERS_AVAILABLE , + SCARD_E_COMM_DATA_LOST , + SCARD_E_NO_KEY_CONTAINER , + SCARD_E_SERVER_TOO_BUSY , + SCARD_W_UNSUPPORTED_CARD , + SCARD_W_UNRESPONSIVE_CARD , + SCARD_W_UNPOWERED_CARD , + SCARD_W_RESET_CARD , + SCARD_W_REMOVED_CARD , + SCARD_W_SECURITY_VIOLATION , + SCARD_W_WRONG_CHV , + SCARD_W_CHV_BLOCKED , + SCARD_W_EOF , + SCARD_W_CANCELLED_BY_USER , + SCARD_W_CARD_NOT_AUTHENTICATED , + ) + #for e in errors: + # print hex((e+0x100000000) & 0xFFFFFFFF) + +def suite(): + suite1 = unittest.makeSuite(testcase_returncodes) + return unittest.TestSuite((suite1)) + + +if __name__ == '__main__': + unittest.main() + Property changes on: trunk/pyscard/src/smartcard/test/scard/testcase_returncodes.py ___________________________________________________________________ Added: svn:executable + * Modified: trunk/pyscard/src/smartcard/test/scard/testsuite_scard.py =================================================================== --- trunk/pyscard/src/smartcard/test/scard/testsuite_scard.py 2009-02-26 10:37:17 UTC (rev 270) +++ trunk/pyscard/src/smartcard/test/scard/testsuite_scard.py 2009-03-01 16:39:27 UTC (rev 271) @@ -39,6 +39,7 @@ 'testcase_listcards', 'testcase_locatecards', 'testcase_readergroups', + 'testcase_returncodes', 'testcase_transaction' ) testsuite_scard = unittest.TestSuite() for module in map(__import__, modules_to_test): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-26 10:37:23
|
Revision: 270 http://pyscard.svn.sourceforge.net/pyscard/?rev=270&view=rev Author: ludov Date: 2009-02-26 10:37:17 +0000 (Thu, 26 Feb 2009) Log Message: ----------- Snow Leopard (10.6) and above are treated like Leopard (10.5) Modified Paths: -------------- trunk/pyscard/src/setup.py Modified: trunk/pyscard/src/setup.py =================================================================== --- trunk/pyscard/src/setup.py 2009-02-23 08:47:51 UTC (rev 269) +++ trunk/pyscard/src/setup.py 2009-02-26 10:37:17 UTC (rev 270) @@ -58,7 +58,7 @@ # Mac OS X Leopard has python 2.5 preinstalled # get_platform() returns a string similar to 'macosx-10.5-i386' # -elif 'macosx-10.5' in get_platform(): +elif 'macosx-10.' in get_platform(): platform__cc_defines=[ ('PCSCLITE', '1'), ('__APPLE__','1'), ('__LEOPARD__','1')] platform_swig_opts=[ '-DPCSCLITE', '-D__APPLE__', '-D__LEOPARD__' ] platform_sources=[] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-23 08:47:53
|
Revision: 269 http://pyscard.svn.sourceforge.net/pyscard/?rev=269&view=rev Author: ludov Date: 2009-02-23 08:47:51 +0000 (Mon, 23 Feb 2009) Log Message: ----------- Sample script to send 2 APDU Added Paths: ----------- trunk/pyscard/src/smartcard/Examples/simple/simpleAPDU.py Added: trunk/pyscard/src/smartcard/Examples/simple/simpleAPDU.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/simple/simpleAPDU.py (rev 0) +++ trunk/pyscard/src/smartcard/Examples/simple/simpleAPDU.py 2009-02-23 08:47:51 UTC (rev 269) @@ -0,0 +1,56 @@ +#! /usr/bin/env python +""" +Sample script to send 2 APDU + +__author__ = "Ludovic Rousseau" + +Copyright 2009 +Author: Ludovic Rousseau, mailto:lud...@fr... + +This file is part of pyscard. + +pyscard is free software; you can redistribute it and/or modify +it under the terms of the GNU Lesser General Public License as published by +the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +pyscard is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Lesser General Public License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with pyscard; if not, write to the Free Software +Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +""" + +import sys +from smartcard.System import readers + +# define the APDUs used in this script +SELECT_APPLET = [0x00, 0xA4, 0x04, 0x00, 0x06, 0xA0, 0x00, 0x00, 0x00, + 0x18, 0xFF] +GET_TIME = [0x80, 0x38, 0x00, 0xA0] + +try: + # get all the available readers + r = readers() + print "Available readers: ", r + + # by default we use the first reader + i = 0 + if len(sys.argv) > 1: + i = int(sys.argv[1]) + print "Using: %s" % r[i] + + connection = r[i].createConnection() + connection.connect() + + data, sw1, sw2 = connection.transmit(SELECT_APPLET) + print "Select Applet: %02X %02X" % (sw1, sw2) + + data, sw1, sw2 = connection.transmit(GET_TIME) + print "Get Time: %02X %02X" % (sw1, sw2) + +except: + print sys.exc_info()[1] Property changes on: trunk/pyscard/src/smartcard/Examples/simple/simpleAPDU.py ___________________________________________________________________ Added: svn:executable + * This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-23 08:21:41
|
Revision: 268 http://pyscard.svn.sourceforge.net/pyscard/?rev=268&view=rev Author: ludov Date: 2009-02-23 08:21:38 +0000 (Mon, 23 Feb 2009) Log Message: ----------- parseATR: convert an ATR in a human readable format Added Paths: ----------- trunk/contrib/parseATR/ trunk/contrib/parseATR/parseATR.py Added: trunk/contrib/parseATR/parseATR.py =================================================================== --- trunk/contrib/parseATR/parseATR.py (rev 0) +++ trunk/contrib/parseATR/parseATR.py 2009-02-23 08:21:38 UTC (rev 268) @@ -0,0 +1,396 @@ +#! /usr/bin/env python +""" + parseATR: convert an ATR in a human readable format + Copyright (C) 2009 Ludovic Rousseau + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +""" + +import smartcard.util + +ATR_PROTOCOL_TYPE_T0 = 0 +ATR_MAX_PROTOCOLS = 7 +T = -1 + +def normalize(atr): + """ transform an ATR in list of integers + valid input formats are + "3B A7 00 40 18 80 65 A2 08 01 01 52" + "3B:A7:00:40:18:80:65:A2:08:01:01:52" + """ + atr = atr.replace(":", " ") + atr = atr.split(" ") + atr = map(lambda x: int(x,16), atr) + return atr + +def int2bin(i, padding = 8): + """ convert an integer into its binary representation """ + b = "" + while i > 0: + b = str(i % 2) + b + i >>= 1 + b = "0" * (padding-len(b)) +b + return b + +def parseATR(atr_txt): + atr_txt = normalize(atr_txt) + atr = {} + # store TS and T0 + atr["TS"] = atr_txt[0] + atr["T0"] = TDi = atr_txt[1] + pointer = 1 + # protocol number + pn = 1 + + # store number of historical bytes + atr["hbn"] = TDi & 0xF + + while (pointer < len(atr_txt)): + # Check TAi is present + if ((TDi | 0xEF) == 0xFF): + pointer += 1 + atr["TA%d" % pn] = atr_txt[pointer] + + # Check TBi is present + if ((TDi | 0xDF) == 0xFF): + pointer += 1 + atr["TB%d" % pn] = atr_txt[pointer] + + # Check TCi is present + if ((TDi | 0xBF) == 0xFF): + pointer += 1 + atr["TC%d" % pn] = atr_txt[pointer] + + # Check TDi is present + if ((TDi | 0x7F) == 0xFF): + pointer += 1 + atr["TD%d" % pn] = TDi = atr_txt[pointer] + if ((TDi & 0x0F) != ATR_PROTOCOL_TYPE_T0): + atr["TCK"] = True + pn += 1 + else: + break + + # Store number of protocols + atr["pn"] = pn + + # Store historical bytes + atr["hb"] = atr_txt[pointer+1:] + + # Store TCK + if (atr.has_key("TCK")): + atr["TCK"] = atr_txt[pointer] + + return atr + +def TA1(v): + Fi = (372, 372, 558, 744, 1116, 1488, 1860, "RFU", "RFU", 512, 768, 1024, 1536, 2048, "RFU", "RFU") + Di = ("RFU", 1, 2, 4, 8, 16, 32, "RFU", 12, 20, "RFU", "RFU", "RFU", "RFU", "RFU", "RFU") + F = v >> 4 + D = v & 0xF + value = Fi[F]/Di[D] + return "Fi=%s, Di=%s, %g cycles/ETU (%d bits/s at 3.57 MHz)" % (Fi[F], Di[D], value, 3571200/value) + +def TA2(v): + F = v >> 4 + D = v & 0xF + text = "Protocol to be used in spec mode: T=%s" % (D), + if (F & 0x8): + text = text + " - Unable to change", + else: + text = text + " - Capable to change", + + if (F & 0x1): + text = text + " - implicity defined" + else: + text = text + " - defined by interface bytes" + + return text + +def TA3(v): + return TAn(3, v) + +def TA4(v): + return TAn(4, v) + +def TAn(i, v): + XI = ("not supported", "state L", "state H", "no preference") + if (T == 1): + text = "IFSC: %s" % v + else: + F = v >> 6 + D = v % 64 + Class = "(3G) " + + if (D & 0x1): + Class += "A 5V " + if (D & 0x2): + Class += "B 3V " + if (D & 0x4): + Class += "C 1.8V " + if (D & 0x8): + Class += "D RFU " + if (D & 0x10): + Class += "E RFU" + + text = "Clock stop: %s - Class accepted by the card: %s" % (XI[F],Class) + return text + +def TB1(v): + I = v >> 5 + PI = v & 0x1F + if (PI == 0): + text = "VPP is not electrically connected" + else: + text = "Programming Param P: %d Volts, I: %d milliamperes" % (PI, I) + return text + +def TB2(v): + text = "Programming param PI2 (PI1 should be ignored): %d" % v, + if ((v>49) or (v<251)): + text += " (dV)" + else: + text += " is RFU" + return text + +def TB3(v): + return TBn(3, v) + +def TB4(v): + return TBn(4, v) + +def TBn(i, v): + text = "" + if (T == 1): + BWI = v >> 4 + CWI = v % 16 + + text = "Block Waiting Integer: %d - Character Waiting Integer: %d" % (BWI, CWI) + return text + +def TC1(v): + text = "Extra guard time:", v, + if (v == 255): + text += "(special value)" + return text + +def TC2(v): + return "Work waiting time: 960 x %d x (Fi/F)" % v + +def TC3(v): + return TCn(3, v) + +def TC4(v): + return TCn(4, v) + +def TCn(i, v): + text = "" + if (T == 1): + text = "Error detection code: ", + if (v == 1): + text += "CRC"; + else: + if (v == 0): + text += "LRC" + else: + text += "RFU" + return text + +def TD1(v): + return TDn(1, v) + +def TD2(v): + return TDn(2, v) + +def TD3(v): + return TDn(3, v) + +def TD4(v): + return TDn(4, v) + +def TDn(i, v): + global T + Y = v >> 4 + T = v & 0xF + text = "Y(i+1) = b%s, Protocol T=%d" % (int2bin(Y,4), T) + return text + +def compact_tlv(historical_bytes): + text = "" + tlv = historical_bytes.pop(0) + + # return if we have NO historical bytes + if tlv == None: + return text + + tag = tlv / 16 + len = tlv % 16 + + if tag == 1: + text += " (country code, ISO 3166-1)" + text += " Country code: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + elif tag == 2: + text += " (issuer identification number, ISO 7812-1)"; + text += " Issuer identification number: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + elif tag == 3: + text += " (card service data byte)" + cs = historical_bytes.pop(0) + if cs == None: + text += " Error in the ATR: expecting 1 byte and got 0" + else: + text += " Card service data byte: %d" % cs + text += cs(cs) + + elif tag == 4: + text += " (initial access data)" + text += " Initial access data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + elif tag == 5: + text += " (card issuer's data)" + text += " Card issuer data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + elif tag == 6: + text += " (pre-issuing data)" + text += " Data: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + elif tag == 7: + text += " (card capabilities)" + if len == 1: + sm = historical_bytes.pop(0) + text += " Selection methods: %d" % sm + text += sm(sm) + elif len == 2: + sm = historical_bytes.pop(0) + dc = historical_bytes.pop(0) + text += " Selection methods: %d" % sm + text += sm(sm) + text += " Data coding byte: %d" % dc + text += dc(dc) + elif len == 3: + sm = historical_bytes.pop(0) + dc = historical_bytes.pop(0) + cc = historical_bytes.pop(0) + text += " Selection methods: %d" % sm + text += sm(sm) + text += " Data coding byte: %d" % dc + text += dc(dc) + text += " Command chaining, length fields and logical channels: %d" % cc + text += cc(cc) + else: + text += " wrong ATR" + + elif tag == 8: + text += " (status indicator)" + if len == 1: + lcs = historical_bytes.pop(0) + text += " LCS (life card cycle): %d" % lcs + elif len == 2: + sw1 = historical_bytes.pop(0) + sw2 = historical_bytes.pop(0) + text += " SW: %02X %02X" % (sw1, sw2) + elif len == 3: + lcs = historical_bytes.pop(0) + sw1 = historical_bytes.pop(0) + sw2 = historical_bytes.pop(0) + text += " LCS (life card cycle): %d" % lcs + text += " SW: %02X %02X" % (sw1, sw2) + + elif tag == 15: + text += " (application identifier)" + text += " Application identifier: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + else: + text += " (unknown)" + text += " Value: " + smartcard.util.toHexString(historical_bytes[:len], smartcard.util.HEX) + + return text + +def analyse_histrorical_bytes(historical_bytes): + text = "" + hb_category = historical_bytes.pop(0) + + # return if we have NO historical bytes + if hb_category == None: + return text + + if hb_category == 0x00: + text += " (compact TLV data object)\n"; + + if historical_bytes.length() < 3: + text += " Error in the ATR: expecting 3 bytes and got %d" % historical_bytes.length() + return text + + # get the 3 last bytes + status = historical_bytes[-3:] + del historical_bytes[-3:] + + while len(historical_bytes) > 0: + text += compact_tlv(historical_bytes) + + (lcs, sw1, sw2) = status[:3] + text += " Mandatory status indicator (3 last bytes)\n"; + text += " LCS (life card cycle): %d (%s)" % (lcs, lcs(lcs)) + text += " SW: %02X%02X (%s)" % (sw1, sw1, "") #Chipcard::PCSC::Card::ISO7816Error("$sw1 $sw2")) + + elif hb_category == 0x80: + text += " (compact TLV data object)" + while len(historical_bytes) > 0: + text += compact_tlv(historical_bytes) + + elif hb_category == 0x10: + text += " (next byte is the DIR data reference)" + data_ref = historical_bytes.pop(0) + text += " DIR data reference: %d", data_ref + + elif hb_category in (0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8A, 0x8B, 0x8C, 0x8D, 0x8E, 0x8F): + text += " (Reserved for future use)"; + + else: + text += " (proprietary format)"; + + return text + +def atr_display_txt(atr): + TS = {0x3B: "Direct Convention", 0x3F: "Inverse Convention"} + print "TS = 0x%02X --> %s" % (atr["TS"], TS[atr["TS"]]) + + Y1 = atr["T0"] >> 4 + K = atr["T0"] & 0xF + print "T0 = 0x%02X, Y(1): b%s, K: %d (historical bytes)" % (atr["T0"], int2bin(Y1, padding = 4), K) + + for i in (1, 2, 3, 4): + separator = False + for p in ("A", "B", "C", "D"): + key = "T%s%d" % (p, i) + if (atr.has_key(key)): + v = atr[key] + print " T%s(%d) = 0x%02X -->" % (p, i, v), + print eval("%s(%d)" % (key, v)) + separator = True + if separator: + print "----" + + if (atr.has_key("hb")): + print "Historical bytes: ", + for b in atr["hb"]: + print "0x%02X" % b, + print analyse_histrorical_bytes(atr["hb"]) + +if __name__ == "__main__": + atr = parseATR("3B A7 00 40 18 80 65 A2 08 01 01 52") + #atr = parseATR("3F FF 95 00 FF 91 81 71 A0 47 00 44 4E 41 53 50 30 31 31 20 52 65 76 42") + atr_display_txt(atr) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-22 20:11:53
|
Revision: 267 http://pyscard.svn.sourceforge.net/pyscard/?rev=267&view=rev Author: ludov Date: 2009-02-22 20:11:49 +0000 (Sun, 22 Feb 2009) Log Message: ----------- SCARD_E_NO_READERS_AVAILABLE is not defined on Mac OS X Leopard (and earlier) so we define it ourself Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/PcscDefs.i Modified: trunk/pyscard/src/smartcard/scard/PcscDefs.i =================================================================== --- trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-02-22 19:53:58 UTC (rev 266) +++ trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-02-22 20:11:49 UTC (rev 267) @@ -304,7 +304,11 @@ %constant TYPE SCARD_E_CARD_UNSUPPORTED = SCARD_E_CARD_UNSUPPORTED ; %constant TYPE SCARD_E_NO_SERVICE = SCARD_E_NO_SERVICE ; %constant TYPE SCARD_E_SERVICE_STOPPED = SCARD_E_SERVICE_STOPPED ; +#ifdef SCARD_E_NO_READERS_AVAILABLE %constant TYPE SCARD_E_NO_READERS_AVAILABLE = SCARD_E_NO_READERS_AVAILABLE ; +#else +%constant TYPE SCARD_E_NO_READERS_AVAILABLE = 0x80100017 ; +#endif %constant TYPE SCARD_E_UNSUPPORTED_FEATURE = SCARD_E_UNSUPPORTED_FEATURE ; %constant TYPE SCARD_W_UNSUPPORTED_CARD = SCARD_W_UNSUPPORTED_CARD ; %constant TYPE SCARD_W_UNRESPONSIVE_CARD = SCARD_W_UNRESPONSIVE_CARD ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-22 19:54:02
|
Revision: 266 http://pyscard.svn.sourceforge.net/pyscard/?rev=266&view=rev Author: ludov Date: 2009-02-22 19:53:58 +0000 (Sun, 22 Feb 2009) Log Message: ----------- getATR.py works also for T=1 cards Removed Paths: ------------- trunk/pyscard/src/smartcard/Examples/simple/getATR_T1.py Deleted: trunk/pyscard/src/smartcard/Examples/simple/getATR_T1.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/simple/getATR_T1.py 2009-02-22 19:40:31 UTC (rev 265) +++ trunk/pyscard/src/smartcard/Examples/simple/getATR_T1.py 2009-02-22 19:53:58 UTC (rev 266) @@ -1,46 +0,0 @@ -#! /usr/bin/env python -""" -Sample script that displays the ATR of inserted cards. - -__author__ = "http://www.gemalto.com" - -Copyright 2001-2008 gemalto -Author: Jean-Daniel Aussel, mailto:jea...@ge... - -This file is part of pyscard. - -pyscard is free software; you can redistribute it and/or modify -it under the terms of the GNU Lesser General Public License as published by -the Free Software Foundation; either version 2.1 of the License, or -(at your option) any later version. - -pyscard is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU Lesser General Public License for more details. - -You should have received a copy of the GNU Lesser General Public License -along with pyscard; if not, write to the Free Software -Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -""" -from smartcard.CardConnection import CardConnection -from smartcard.Exceptions import NoCardException, CardConnectionException -from smartcard.System import readers -from smartcard.util import toHexString - -for reader in readers(): - try: - connection=reader.createConnection() - connection.connect( CardConnection.T1_protocol ) - print reader, toHexString( connection.getATR() ) - except NoCardException: - print reader, 'no card inserted' - except CardConnectionException, e: - print reader, e - - -import sys -if 'win32'==sys.platform: - print 'press Enter to continue' - sys.stdin.read(1) - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-22 19:40:34
|
Revision: 265 http://pyscard.svn.sourceforge.net/pyscard/?rev=265&view=rev Author: ludov Date: 2009-02-22 19:40:31 +0000 (Sun, 22 Feb 2009) Log Message: ----------- add SCARD_E_NO_READERS_AVAILABLE definition Modified Paths: -------------- trunk/pyscard/src/smartcard/scard/PcscDefs.i Modified: trunk/pyscard/src/smartcard/scard/PcscDefs.i =================================================================== --- trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-02-16 09:41:07 UTC (rev 264) +++ trunk/pyscard/src/smartcard/scard/PcscDefs.i 2009-02-22 19:40:31 UTC (rev 265) @@ -304,6 +304,7 @@ %constant TYPE SCARD_E_CARD_UNSUPPORTED = SCARD_E_CARD_UNSUPPORTED ; %constant TYPE SCARD_E_NO_SERVICE = SCARD_E_NO_SERVICE ; %constant TYPE SCARD_E_SERVICE_STOPPED = SCARD_E_SERVICE_STOPPED ; +%constant TYPE SCARD_E_NO_READERS_AVAILABLE = SCARD_E_NO_READERS_AVAILABLE ; %constant TYPE SCARD_E_UNSUPPORTED_FEATURE = SCARD_E_UNSUPPORTED_FEATURE ; %constant TYPE SCARD_W_UNSUPPORTED_CARD = SCARD_W_UNSUPPORTED_CARD ; %constant TYPE SCARD_W_UNRESPONSIVE_CARD = SCARD_W_UNRESPONSIVE_CARD ; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-16 09:41:18
|
Revision: 264 http://pyscard.svn.sourceforge.net/pyscard/?rev=264&view=rev Author: ludov Date: 2009-02-16 09:41:07 +0000 (Mon, 16 Feb 2009) Log Message: ----------- use SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 instead of just SCARD_PROTOCOL_T0 Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2009-02-16 09:40:05 UTC (rev 263) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_getAttrib.py 2009-02-16 09:41:07 UTC (rev 264) @@ -149,7 +149,7 @@ for reader in readers: hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, reader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 ) + hcontext, reader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 ) if hresult!=0: print error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) else: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <lu...@us...> - 2009-02-16 09:40:08
|
Revision: 263 http://pyscard.svn.sourceforge.net/pyscard/?rev=263&view=rev Author: ludov Date: 2009-02-16 09:40:05 +0000 (Mon, 16 Feb 2009) Log Message: ----------- use SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 instead of just SCARD_PROTOCOL_T0 Modified Paths: -------------- trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2009-01-27 09:04:39 UTC (rev 262) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_pinpad.py 2009-02-16 09:40:05 UTC (rev 263) @@ -80,7 +80,7 @@ try: hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, zreader, SCARD_SHARE_DIRECT, SCARD_PROTOCOL_T0 ) + hcontext, zreader, SCARD_SHARE_DIRECT, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult!=0: raise error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) print 'Connected with active protocol', dwActiveProtocol Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py 2009-01-27 09:04:39 UTC (rev 262) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_selectDFTelecom.py 2009-02-16 09:40:05 UTC (rev 263) @@ -52,17 +52,17 @@ try: hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 ) + hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1 ) if hresult!=0: raise error, 'Unable to connect: ' + SCardGetErrorMessage(hresult) print 'Connected with active protocol', dwActiveProtocol try: - hresult, response = SCardTransmit( hcard, SCARD_PCI_T0, SELECT + DF_TELECOM ) + hresult, response = SCardTransmit( hcard, dwActiveProtocol, SELECT + DF_TELECOM ) if hresult!=0: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) print 'Selected DF_TELECOM: ' + smartcard.util.toHexString(response, smartcard.util.HEX) - hresult, response = SCardTransmit( hcard, SCARD_PCI_T0, GET_RESPONSE + [response[1]] ) + hresult, response = SCardTransmit( hcard, dwActiveProtocol, GET_RESPONSE + [response[1]] ) if hresult!=0: raise error, 'Failed to transmit: ' + SCardGetErrorMessage(hresult) print 'GET_RESPONSE after SELECT DF_TELECOM: ' + smartcard.util.toHexString(response, smartcard.util.HEX) Modified: trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py =================================================================== --- trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py 2009-01-27 09:04:39 UTC (rev 262) +++ trunk/pyscard/src/smartcard/Examples/scard-api/sample_transaction.py 2009-02-16 09:40:05 UTC (rev 263) @@ -47,7 +47,7 @@ try: hresult, hcard, dwActiveProtocol = SCardConnect( - hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 ) + hcontext, zreader, SCARD_SHARE_SHARED, SCARD_PROTOCOL_T0 | SCARD_PROTOCOL_T1) if hresult!=0: raise error, 'unable to connect: ' + SCardGetErrorMessage(hresult) print 'Connected with active protocol', dwActiveProtocol This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |