1.1.0 fixes
Fix PIN management PINPAD CCID command was in conflict with new PIN get status APDU. Use class CLA=0xEF to differenciate both case. Fix Terminate status management Fix RC code setting Add MSE support Set MSE supported in capabilities
This commit is contained in:
parent
38e143d248
commit
cf6e295e47
11 changed files with 128 additions and 35 deletions
|
@ -109,6 +109,7 @@ class GPGCard() :
|
|||
if device.startswith("ledger:"):
|
||||
self.token = getDongle(True)
|
||||
self.exchange = self._exchange_ledger
|
||||
self.disconnect = self._disconnect_ledger
|
||||
elif device.startswith("pcsc:"):
|
||||
allreaders = readers()
|
||||
for r in allreaders:
|
||||
|
@ -120,6 +121,7 @@ class GPGCard() :
|
|||
self.connection = r.createConnection()
|
||||
self.connection.connect()
|
||||
self.exchange = self._exchange_pcsc
|
||||
self.disconnect = self._disconnect_pcsc
|
||||
else:
|
||||
#print("No")
|
||||
pass
|
||||
|
@ -127,6 +129,8 @@ class GPGCard() :
|
|||
print("No token")
|
||||
|
||||
|
||||
|
||||
|
||||
### APDU interface ###
|
||||
def _exchange_ledger(self,cmd,sw=0x9000):
|
||||
resp = b''
|
||||
|
@ -159,6 +163,14 @@ class GPGCard() :
|
|||
sw = (sw1<<8)|sw2
|
||||
#print("xch S resp: %s %.04x"%(binascii.hexlify(resp),sw))
|
||||
return resp,sw
|
||||
|
||||
def _disconnect_ledger(self):
|
||||
return self.token.close()
|
||||
|
||||
def _disconnect_pcsc(self):
|
||||
r = self.connection.disconnect()
|
||||
#self.connection.releaseContext()
|
||||
return r
|
||||
|
||||
def select(self):
|
||||
apdu = binascii.unhexlify(b"00A4040006D27600012401")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue