laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/35455?usp=email )
(
1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: Fix TLV_IE_Collection.from_tlv in certain situations
......................................................................
Fix TLV_IE_Collection.from_tlv in certain situations
The existing code used to produce an empty output in situations where a
TLV_IE_Collection would be parsed from a single TLV only with some
additional trailing padding:
>>> from pySim.utils import h2b
>>> from pySim.ts_31_102 import EF_CSGT
>>> t = EF_CSGT.Csgt_TLV_Collection()
>>> t.from_tlv(h2b('8906810300666f6fff'))
[TextCsgType(foo)]
>>> t.to_dict()
[]
This was caused by an early return (actually returning the decoded
result) but *without updating self.children*.
Change-Id: I1c84ccf698c6ff7e7f14242f9aaf7d15ac2239f4
---
M pySim/tlv.py
1 file changed, 25 insertions(+), 1 deletion(-)
Approvals:
fixeria: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 4ac5ebf..ccf049e 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -361,7 +361,7 @@
# obtain the tag at the start of the remainder
tag, r = first._parse_tag_raw(remainder)
if tag == None:
- return res
+ break
if tag in self.members_by_tag:
cls = self.members_by_tag[tag]
# create an instance and parse accordingly
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35455?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1c84ccf698c6ff7e7f14242f9aaf7d15ac2239f4
Gerrit-Change-Number: 35455
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
Attention is currently required from: dexter, fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35452?usp=email )
Change subject: Implement convoluted encoding of UCS-2 as per TS 102 221 Annex A
......................................................................
Patch Set 6:
(2 comments)
File pySim/construct.py:
https://gerrit.osmocom.org/c/pysim/+/35452/comment/88c1b685_619fccae
PS5, Line 79: ch.to_bytes(1, byteorder='big'),
> Not critical, but for just one byte I would rather do `bytes([ch])`. Same below.
Done
https://gerrit.osmocom.org/c/pysim/+/35452/comment/31d5f9f4_6722184e
PS5, Line 81: elif obj[0] == 0x82:
> We may want to raise an exception if `obj[0]` is neither `0x81` nor `0x82`, rather than returning `N […]
Done
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35452?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic8bc8f71079faec1bf0e538dc0dfa21403869c6d
Gerrit-Change-Number: 35452
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 29 Dec 2023 17:52:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: comment