vicc: debug parsed APDU
closes https://github.com/frankmorgner/vsmartcard/pull/103/
This commit is contained in:
@@ -283,12 +283,8 @@ class Iso7816OS(SmartcardOS):
|
||||
"""
|
||||
raise SwError(SW["ERR_INSNOTSUPPORTED"])
|
||||
|
||||
logging.info("Command APDU (%d bytes):\n %s", len(msg),
|
||||
hexdump(msg, indent=2))
|
||||
|
||||
try:
|
||||
c = C_APDU(msg)
|
||||
logging.debug("%s", str(c))
|
||||
except ValueError as e:
|
||||
logging.warning(str(e))
|
||||
return self.formatResult(False, 0, b"",
|
||||
@@ -608,9 +604,20 @@ class VirtualICC(object):
|
||||
|
||||
logging.info("Command APDU (%d bytes):\n %s\n", len(msg),
|
||||
hexdump(msg, indent=2))
|
||||
try:
|
||||
logging.debug(str(C_APDU(msg)))
|
||||
except:
|
||||
pass
|
||||
|
||||
answer = self.os.execute(msg)
|
||||
|
||||
try:
|
||||
logging.debug(str(R_APDU(answer)))
|
||||
except:
|
||||
pass
|
||||
logging.info("Response APDU (%d bytes):\n %s\n", len(answer),
|
||||
hexdump(answer, indent=2))
|
||||
|
||||
self.__sendToVPICC(answer)
|
||||
|
||||
def stop(self):
|
||||
|
||||
Reference in New Issue
Block a user