Change in pysim[master]: sysmoISIM-SJA2: Fill unused bytes of Home ePDGId with 'f'

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Tue Jan 5 14:22:42 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/21867 )

Change subject: sysmoISIM-SJA2: Fill unused bytes of Home ePDGId with 'f'
......................................................................

sysmoISIM-SJA2: Fill unused bytes of Home ePDGId with 'f'

Change-Id: Ia0464f230afcb0f37465d3ed0dfd8f417b53b0c3
---
M pySim/cards.py
1 file changed, 9 insertions(+), 3 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



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 @@
 			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 @@
 			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']):

-- 
To view, visit https://gerrit.osmocom.org/c/pysim/+/21867
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia0464f230afcb0f37465d3ed0dfd8f417b53b0c3
Gerrit-Change-Number: 21867
Gerrit-PatchSet: 5
Gerrit-Owner: herlesupreeth <herlesupreeth at gmail.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210105/29c3503d/attachment.htm>


More information about the gerrit-log mailing list