mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-04-01 01:37:36 +03:00
ts_31_102: EF SUCI_Calc_Info: fix decoding empty files
When trying to use `edit_binary_decoded` with an empty file, pysim runs into a len(None) exception, because hpkl.to_dict()['hnet_pubkey_list'] returns None. Can reproduced with a CCC Camp 2023 usim and editing the file. Change-Id: Ib8e322e65dd768bfd49e7a5620a2163f12a74ec7
This commit is contained in:
@@ -389,7 +389,10 @@ class EF_SUCI_Calc_Info(TransparentEF):
|
|||||||
# remaining data holds Home Network Public Key Data Object
|
# remaining data holds Home Network Public Key Data Object
|
||||||
hpkl = EF_SUCI_Calc_Info.HnetPubkeyList()
|
hpkl = EF_SUCI_Calc_Info.HnetPubkeyList()
|
||||||
hpkl.from_tlv(in_bytes[pos:])
|
hpkl.from_tlv(in_bytes[pos:])
|
||||||
hnet_pubkey_list = self._compact_pubkey_list(hpkl.to_dict()['hnet_pubkey_list'])
|
|
||||||
|
hnet_pubkey_list = []
|
||||||
|
if hpkl.to_dict()['hnet_pubkey_list']:
|
||||||
|
hnet_pubkey_list = self._compact_pubkey_list(hpkl.to_dict()['hnet_pubkey_list'])
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'prot_scheme_id_list': prot_scheme_id_list,
|
'prot_scheme_id_list': prot_scheme_id_list,
|
||||||
|
|||||||
Reference in New Issue
Block a user