Change-Id: I3217b10ff058177111ba421bed2094e98e70a508
pmaier/aram
Philipp Maier 1 year ago
parent 8d8bdef637
commit 2213547d08
  1. 4
      pySim/ara_m.py
  2. 20
      pySim/ts_102_221.py

@ -337,6 +337,10 @@ class ADF_ARAM(CardADF):
if res_do:
self._cmd.poutput_json(res_do.to_dict())
def decode_select_response(self, data_hex):
print("CAUGHT!")
return pySim.ts_51_011.CardProfileSIM.decode_select_response(data_hex)
# SEAC v1.1 Section 4.1.2.2 + 5.1.2.2
sw_aram = {

@ -675,20 +675,24 @@ class CardProfileUICC(CardProfile):
@staticmethod
def decode_select_response(resp_hex:str) -> object:
"""ETSI TS 102 221 Section 11.1.1.3"""
print(resp_hex)
fixup_fcp_proprietary_tlv_map(FCP_Proprietary_TLV_MAP)
resp_hex = resp_hex.upper()
# outer layer
fcp_base_tlv = TLV(['62'])
fcp_base = fcp_base_tlv.parse(resp_hex)
# actual FCP
fcp_tlv = TLV(FCP_TLV_MAP)
fcp = fcp_tlv.parse(fcp_base['62'])
# further decode the proprietary information
if 'A5' in fcp:
prop_tlv = TLV(FCP_Proprietary_TLV_MAP)
prop = prop_tlv.parse(fcp['A5'])
fcp['A5'] = tlv_val_interpret(FCP_prorietary_interpreter_map, prop)
fcp['A5'] = tlv_key_replace(FCP_Proprietary_TLV_MAP, fcp['A5'])
if '62' in fcp_base:
fcp_tlv = TLV(FCP_TLV_MAP)
fcp = fcp_tlv.parse(fcp_base['62'])
# further decode the proprietary information
if 'A5' in fcp:
prop_tlv = TLV(FCP_Proprietary_TLV_MAP)
prop = prop_tlv.parse(fcp['A5'])
fcp['A5'] = tlv_val_interpret(FCP_prorietary_interpreter_map, prop)
fcp['A5'] = tlv_key_replace(FCP_Proprietary_TLV_MAP, fcp['A5'])
else:
return resp_hex
# finally make sure we get human-readable keys in the output dict
r = tlv_val_interpret(FCP_interpreter_map, fcp)
return tlv_key_replace(FCP_TLV_MAP, r)

Loading…
Cancel
Save