Change in pysim[master]: utils.py: Bugfix for parsing non-programmed EFePDGSelection

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 09:53:49 UTC 2021


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

Change subject: utils.py: Bugfix for parsing non-programmed EFePDGSelection
......................................................................

utils.py: Bugfix for parsing non-programmed EFePDGSelection

Change-Id: I3a16af785d8ae9ea8730771367bba2d50690b414
---
M pySim/utils.py
M pysim-testdata/sysmoISIM-SJA2.ok
2 files changed, 9 insertions(+), 3 deletions(-)

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



diff --git a/pySim/utils.py b/pySim/utils.py
index ebc2a95..cdb2926 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -651,6 +651,7 @@
 def format_ePDGSelection(hexstr):
 	ePDGSelection_info_tag_chars = 2
 	ePDGSelection_info_tag_str = hexstr[:2]
+	s = ""
 	# Minimum length
 	len_chars = 2
 	# TODO: Need to determine length properly - definite length support only
@@ -659,6 +660,11 @@
 	# But, each PLMN entry is made of PLMN (3 Bytes) + ePDG Priority (2 Bytes) + ePDG FQDN format (1 Byte)
 	# Totalling to 6 Bytes, maybe length should be 6n
 	len_str = hexstr[ePDGSelection_info_tag_chars:ePDGSelection_info_tag_chars+len_chars]
+
+	# Not programmed scenario
+	if int(len_str, 16) == 255 or int(ePDGSelection_info_tag_str, 16) == 255:
+		len_chars = 0
+		ePDGSelection_info_tag_chars = 0
 	if len_str[0] == '8':
 		# The bits 7 to 1 denotes the number of length octets if length > 127
 		if int(len_str[1]) > 0:
@@ -669,7 +675,6 @@
 	content_str = hexstr[ePDGSelection_info_tag_chars+len_chars:]
 	# Right pad to prevent index out of range - multiple of 6 bytes
 	content_str = rpad(content_str, len(content_str) + (12 - (len(content_str) % 12)))
-	s = ""
 	for rec_data in hexstr_to_Nbytearr(content_str, 6):
 		rec_info = dec_ePDGSelection(rec_data)
 		if rec_info['mcc'] == 0xFFF and rec_info['mnc'] == 0xFFF:
diff --git a/pysim-testdata/sysmoISIM-SJA2.ok b/pysim-testdata/sysmoISIM-SJA2.ok
index b6836e7..94c4328 100644
--- a/pysim-testdata/sysmoISIM-SJA2.ok
+++ b/pysim-testdata/sysmoISIM-SJA2.ok
@@ -108,7 +108,7 @@
 	ffffff # unused
 	ffffff # unused
 
-USIM Service Table: beff9f9de73e0408400170730000002e00000000
+USIM Service Table: beff9f9de73e0408400170330006002e00000000
 	Service 2 - Fixed Dialling Numbers (FDN)
 	Service 3 - Extension 2
 	Service 4 - Service Dialling Numbers (SDN)
@@ -156,7 +156,8 @@
 	Service 90 - Operator CSG Lists and corresponding indications
 	Service 93 - Communication Control for IMS by USIM
 	Service 94 - Extended Terminal Applications
-	Service 95 - Support of UICC access to IMS
+	Service 106 - ePDG configuration Information support
+	Service 107 - ePDG configuration Information configured
 	Service 122 - 5GS Mobility Management Information
 	Service 123 - 5G Security Parameters
 	Service 124 - Subscription identifier privacy support

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I3a16af785d8ae9ea8730771367bba2d50690b414
Gerrit-Change-Number: 21939
Gerrit-PatchSet: 3
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/1598199f/attachment.htm>


More information about the gerrit-log mailing list