diff options
-rw-r--r-- | cards/cyberflex_card.py | 4 | ||||
-rw-r--r-- | cards/generic_card.py | 2 | ||||
-rw-r--r-- | utils.py | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/cards/cyberflex_card.py b/cards/cyberflex_card.py index db5bf2a..ac7112e 100644 --- a/cards/cyberflex_card.py +++ b/cards/cyberflex_card.py @@ -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: diff --git a/cards/generic_card.py b/cards/generic_card.py index 32b0ef5..8a82b62 100644 --- a/cards/generic_card.py +++ b/cards/generic_card.py @@ -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: @@ -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): |