diff options
author | Harald Welte <laforge@osmocom.org> | 2024-02-01 19:39:49 +0100 |
---|---|---|
committer | Harald Welte <laforge@osmocom.org> | 2024-02-04 14:53:07 +0100 |
commit | 5dc8471526c099849bffd892477464c85fbd9364 (patch) | |
tree | 787ad89501de4975fcb3a109379cba3ce54aa624 /pySim/global_platform/__init__.py | |
parent | 5bbd720512209ce4c64c9b584a6e1d9a178ee159 (diff) |
global_platform: Add install_for_personalization command
This allows us to perform STORE DATA on applications like ARA-M/ARA-D
after establishing SCP02 to the related security domain.
Change-Id: I2ce766b97bba42c64c4d4492b505be66c24f471e
Diffstat (limited to 'pySim/global_platform/__init__.py')
-rw-r--r-- | pySim/global_platform/__init__.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pySim/global_platform/__init__.py b/pySim/global_platform/__init__.py index ad193ee..5492e44 100644 --- a/pySim/global_platform/__init__.py +++ b/pySim/global_platform/__init__.py @@ -584,6 +584,20 @@ class ADF_SD(CardADF): p2 |= 0x01 return grd_list + inst_perso_parser = argparse.ArgumentParser() + inst_perso_parser.add_argument('application-aid', type=is_hexstr, help='Application AID') + + @cmd2.with_argparser(inst_perso_parser) + def do_install_for_personalization(self, opts): + """Perform GlobalPlatform INSTALL [for personalization] command in order toinform a Security + Domain that the following STORE DATA commands are meant for a specific AID (specified here).""" + # Section 11.5.2.3.6 / Table 11-47 + self.install(0x20, 0x00, "0000%02u%s000000" % (len(opts.application_aid)//2, opts.application_aid)) + + def install(self, p1:int, p2:int, data:Hexstr) -> ResTuple: + cmd_hex = "80E6%02x%02x%02x%s" % (p1, p2, len(data)//2, data) + return self._cmd.lchan.scc.send_apdu_checksw(cmd_hex) + est_scp02_parser = argparse.ArgumentParser() est_scp02_parser.add_argument('--key-ver', type=auto_uint8, required=True, help='Key Version Number (KVN)') |