The _wrap_cmd_apdu methods for SCP02 and SCP03 are a bit hard to read. Let's refactor them so that it is easier to understand what happens. In particular that one can not have encryption (cenc) without signing (cmac)
pySim/transport add support for T=1 protocol and fix APDU/TPDU layer conflicts
ETSI TS 102 221, section 7.3 specifies that UICCs (and eUICCs) may support two different transport protocols: T=0 or T=1 or both. The spec also says that the terminal must support both protocols.
This patch adds the necessary functionality to support the T=1 protocol alongside the T=0 protocol. However, this also means that we have to sharpen the lines between APDUs and TPDUs.
pySim-shell_test: add new testcase for card initialization
The card initialization normally takes place automatically. Nearly all testcases implicitly cover this code-path. However, it is also possible to skip the card initialization and do it at some later point. This is commonly the case for unprovisioned card that require some custom APDUs in a basic initialization step. When this step is done one would use the "equip" command to level up to the full featured mode. This patch adds a testcase for this scenario