aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenryk Plötz <henryk@ploetzli.ch>2010-10-15 16:37:26 +0200
committerHenryk Plötz <henryk@ploetzli.ch>2010-10-15 17:08:08 +0200
commit9e8b7b0a82dc8e4fc8c07f26c87f4b706c679d6e (patch)
treeaba1cb0277f487f82f1cc1e429847ec134b587a6
parent04af868a4caf0471bf0b68d71ad567ff88de68d0 (diff)
Refactor: rename APDU_GET_RESPONSE to COMMAND_GET_RESPONSE
-rw-r--r--cards/generic_card.py4
-rw-r--r--cards/gsm_card.py3
-rw-r--r--cards/iso_card.py3
-rw-r--r--cards/postcard_card.py3
4 files changed, 8 insertions, 5 deletions
diff --git a/cards/generic_card.py b/cards/generic_card.py
index 48f0a7f..94d8cc7 100644
--- a/cards/generic_card.py
+++ b/cards/generic_card.py
@@ -9,7 +9,7 @@ DEBUG = True
_GENERIC_NAME = "Generic"
class Card:
DRIVER_NAME = [_GENERIC_NAME]
- APDU_GET_RESPONSE = None
+ COMMAND_GET_RESPONSE = None
## Constants for check_sw()
PURPOSE_SUCCESS = 1 # Command executed successful
@@ -153,7 +153,7 @@ class Card:
if self.check_sw(result.sw, self.PURPOSE_GET_RESPONSE):
## Need to call GetResponse
- gr_apdu = C_APDU(self.APDU_GET_RESPONSE, le = result.sw2, cla=apdu.cla) # FIXME
+ gr_apdu = C_APDU(self.COMMAND_GET_RESPONSE, le = result.sw2, cla=apdu.cla) # FIXME
result = R_APDU(self._real_send(gr_apdu))
elif self.check_sw(result.sw, self.PURPOSE_RETRY) and apdu.Le == 0:
## Retry with correct Le
diff --git a/cards/gsm_card.py b/cards/gsm_card.py
index 408dd46..e00d1a1 100644
--- a/cards/gsm_card.py
+++ b/cards/gsm_card.py
@@ -3,7 +3,8 @@ from iso_card import *
class GSM_Card(ISO_Card):
DRIVER_NAME = ["GSM"]
- APDU_GET_RESPONSE = C_APDU("\xa0\xC0\x00\x00")
+ COMMAND_GET_RESPONSE = C_APDU("\xa0\xC0\x00\x00")
+
STATUS_MAP = {
Card.PURPOSE_GET_RESPONSE: ("9F??", )
}
diff --git a/cards/iso_card.py b/cards/iso_card.py
index feda66d..fb3b016 100644
--- a/cards/iso_card.py
+++ b/cards/iso_card.py
@@ -5,7 +5,8 @@ from utils import C_APDU, R_APDU
class ISO_Card(Card):
DRIVER_NAME = ["ISO"]
- APDU_GET_RESPONSE = C_APDU(ins=0xc0)
+ COMMAND_GET_RESPONSE = C_APDU(ins=0xc0)
+
APDU_VERIFY_PIN = C_APDU(ins=0x20)
## Map for check_sw()
diff --git a/cards/postcard_card.py b/cards/postcard_card.py
index 7a1e917..8fed6eb 100644
--- a/cards/postcard_card.py
+++ b/cards/postcard_card.py
@@ -4,7 +4,8 @@ from iso_7816_4_card import *
class Postcard_Card(ISO_7816_4_Card):
DRIVER_NAME = ["Postcard"]
CLA = 0xbc
- APDU_GET_RESPONSE = C_APDU(cla=CLA,ins=0xc0)
+ COMMAND_GET_RESPONSE = C_APDU(cla=CLA,ins=0xc0)
+
APDU_SELECT_FILE = C_APDU(cla=CLA,ins=0xa4)
APDU_READ_BINARY = C_APDU(cla=CLA,ins=0xb0,le=0x80)