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

@@ -319,7 +319,7 @@ class CardApplicationISDR(pySim.global_platform.CardApplicationSD):
"""Perform STORE DATA according to Table 47+48 in Section 5.7.2 of SGP.22.
Only single-block store supported for now."""
capdu = '%sE29100%02x%s' % (scc.cla4lchan('80'), len(tx_do)//2, tx_do)
return scc._tp.send_apdu_checksw(capdu)
return scc.send_apdu_checksw(capdu)
@staticmethod
def store_data_tlv(scc: SimCardCommands, cmd_do, resp_cls, exp_sw='9000'):