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:
hploetz 2006-05-18 16:26:21 +00:00
parent c68e8bba2e
commit f2bb9004cb
3 changed files with 4 additions and 4 deletions

View File

@ -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:

View File

@ -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:

View File

@ -155,7 +155,7 @@ class APDU(object):
"The data contents of this APDU")
def _setbyte(self, name, value):
print "setbyte(%r, %r)" % (name, value)
#print "setbyte(%r, %r)" % (name, value)
if isinstance(value, int):
setattr(self, "_"+name, value)
elif isinstance(value, str):