more bugfixes. open_secure_channel does now work
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@54 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
parent
c68e8bba2e
commit
f2bb9004cb
|
@ -18,7 +18,7 @@ MAC_LENGTH = 8
|
|||
class Cyberflex_Card(Java_Card):
|
||||
APDU_INITIALIZE_UPDATE = C_APDU('\x80\x50\x00\x00')
|
||||
APDU_EXTERNAL_AUTHENTICATE = C_APDU('\x84\x82\x00\x00')
|
||||
APDU_GET_STATUS = C_APDU('\x84\xF2\x00\x00\x4f') ## TODO: C_APDU('\x84\xF2\x00\x00\x4f\x00') ?
|
||||
APDU_GET_STATUS = C_APDU('\x84\xF2\x00\x00\x02\x4f\x00')
|
||||
APDU_DELETE = C_APDU('\x84\xe4\x00\x00')
|
||||
DRIVER_NAME = "Cyberflex"
|
||||
|
||||
|
@ -65,7 +65,7 @@ class Cyberflex_Card(Java_Card):
|
|||
def before_send(self, apdu):
|
||||
"""Will be called by send_apdu before sending a command APDU.
|
||||
Is responsible for authenticating/encrypting commands when needed."""
|
||||
if apdu.cla == '\x84':
|
||||
if apdu.cla == 0x84:
|
||||
## Need security
|
||||
|
||||
if self.secure_channel_state == SECURE_CHANNEL_NONE:
|
||||
|
|
|
@ -88,7 +88,7 @@ class Card:
|
|||
|
||||
if result.sw1 == 0x61:
|
||||
## Need to call GetResponse
|
||||
gr_apdu = C_APDU(self.APDU_GET_RESPONSE, le = result[1]).render() # FIXME
|
||||
gr_apdu = C_APDU(self.APDU_GET_RESPONSE, le = result.sw2) # FIXME
|
||||
result = R_APDU(self._real_send(gr_apdu))
|
||||
|
||||
if DEBUG:
|
||||
|
|
Loading…
Reference in New Issue