diff options
author | Supreeth Herle <herlesupreeth@gmail.com> | 2020-03-25 12:51:38 +0100 |
---|---|---|
committer | herlesupreeth <herlesupreeth@gmail.com> | 2021-01-05 11:46:41 +0100 |
commit | 4779034f9e95714cf8b6f8a692ede344983feaa4 (patch) | |
tree | af5d2a049c9a2768087598ee67235ae389fffe05 | |
parent | 79f43dda3d0700ef2cc4e3e06595a8f207a866bf (diff) |
sysmoISIM-SJA2: Fill unused bytes of Home ePDGId with 'f'
Change-Id: Ia0464f230afcb0f37465d3ed0dfd8f417b53b0c3
-rw-r--r-- | pySim/cards.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/pySim/cards.py b/pySim/cards.py index 7e47916..d60b27a 100644 --- a/pySim/cards.py +++ b/pySim/cards.py @@ -274,7 +274,11 @@ class UsimCard(Card): return (None, sw) def update_epdgid(self, epdgid): - epdgid_tlv = enc_addr_tlv(epdgid) + size = self._scc.binary_size(EF_USIM_ADF_map['ePDGId']) * 2 + if len(epdgid) > 0: + epdgid_tlv = rpad(enc_addr_tlv(epdgid), size) + else: + epdgid_tlv = rpad('ff', size) data, sw = self._scc.update_binary( EF_USIM_ADF_map['ePDGId'], epdgid_tlv) return sw @@ -1284,8 +1288,10 @@ class SysmoISIMSJA2(UsimCard, IsimCard): if self.file_exists(EF_USIM_ADF_map['ePDGId']): if p.get('epdgid'): sw = self.update_epdgid(p['epdgid']) - if sw != '9000': - print("Programming ePDGId failed with code %s"%sw) + else: + sw = self.update_epdgid("") + if sw != '9000': + print("Programming ePDGId failed with code %s"%sw) # update EF.ePDGSelection in ADF.USIM if self.file_exists(EF_USIM_ADF_map['ePDGSelection']): |