pySim.app: Attempt to retrieve the EID of a SGP.22 / SGP.32 eUICC

... and populate the RuntimeState.identity['EID'] wit it, so other
[future] parts of the system can use it.

Let's also print the EID (if available) from the 'cardinfo' shell
command.

Change-Id: Idc2ea1d9263f39b3dff403e1535a5e6c4e88b26f
This commit is contained in:
Harald Welte
2024-05-25 10:46:24 +02:00
parent 7f6102365c
commit e4450afb4e
3 changed files with 22 additions and 0 deletions

View File

@@ -345,6 +345,13 @@ class CardApplicationISDR(pySim.global_platform.CardApplicationSD):
else:
return None
@staticmethod
def get_eid(scc: SimCardCommands) -> str:
ged_cmd = GetEuiccData(children=[TagList(decoded=[0x5A])])
ged = CardApplicationISDR.store_data_tlv(scc, ged_cmd, GetEuiccData)
d = ged.to_dict()
return flatten_dict_lists(d['get_euicc_data'])['eid_value']
def decode_select_response(self, data_hex: Hexstr) -> object:
t = FciTemplate()
t.from_tlv(h2b(data_hex))