commands.py: Wrap the transport send_apdu* methods

Let's not have higher level code directly call the transports send_apdu*
methods.  We do this as a precursor to introducing secure channel
support, where the secure channel driver would add MAC and/or encrypt
APDUs before they are sent to the transport.

Change-Id: I1b870140959aa8241cda2246e74576390123cb2d
This commit is contained in:
Harald Welte
2024-01-31 19:32:25 +01:00
parent 5918345c78
commit eecef54eee
6 changed files with 121 additions and 104 deletions

View File

@@ -245,7 +245,7 @@ Online manual available at https://downloads.osmocom.org/docs/pysim/master/html/
# noted that the apdu command plays an exceptional role since it is the only card accessing command that
# can be executed without the presence of a runtime state (self.rs) object. However, this also means that
# self.lchan is also not present (see method equip).
data, sw = self.card._scc._tp.send_apdu(opts.APDU)
data, sw = self.card._scc.send_apdu(opts.APDU)
if data:
self.poutput("SW: %s, RESP: %s" % (sw, data))
else: