Attention is currently required from: laforge, lynxis lazus, neels.
Hello Jenkins Builder, laforge, neels,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41686?usp=email
to look at the new patch set (#2).
The following approvals got outdated and were removed: Code-Review+1 by laforge, Code-Review+2 by neels, Verified+1 by Jenkins Builder
The change is no longer submittable: Code-Review and Verified are unsatisfied now.
Change subject: saip: rework file sizes for "half-defined" template files ......................................................................
saip: rework file sizes for "half-defined" template files
Define the file size early if possible. Some templates (e.g. for 5GS) define files which aren't completely defined. Fixes the parsing for 5GS SUCI_Calc_Info which doesn't have a file size defined.
The saip-tool will other crash when reading a 5G enabled profile: ``` Traceback (most recent call last): File "./contrib/saip-tool.py", line 458, in <module> pes = ProfileElementSequence.from_der(f.read()) File "pySim/esim/saip/__init__.py", line 1679, in from_der inst.parse_der(der) ~~~~~~~~~~~~~~^^^^^ File "pySim/esim/saip/__init__.py", line 1552, in parse_der self.pe_list.append(ProfileElement.from_der(first_tlv, pe_sequence=self)) ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "pySim/esim/saip/__init__.py", line 557, in from_der inst._post_decode() ~~~~~~~~~~~~~~~~~^^ File "pySim/esim/saip/__init__.py", line 668, in _post_decode self.pe2files() ~~~~~~~~~~~~~^^ File "pySim/esim/saip/__init__.py", line 655, in pe2files file = File(k, v, template.files_by_pename.get(k, None)) File "pySim/esim/saip/__init__.py", line 133, in __init__ self.from_tuples(l) ~~~~~~~~~~~~~~~~^^^ File "pySim/esim/saip/__init__.py", line 358, in from_tuples self._body = self.file_content_from_tuples(l) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^ File "pySim/esim/saip/__init__.py", line 393, in file_content_from_tuples stream.write(self.template.expand_default_value_pattern(self.file_size)) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ File "pySim/esim/saip/templates.py", line 123, in expand_default_value_pattern raise ValueError("%s does not have a default length" % self) ValueError: FileTemplate(EF.SUCI_Calc_Info) does not have a default length ```
Change-Id: I7c4a0914aef1049a416e6b091f23daab39a1dd9c --- M pySim/esim/saip/__init__.py 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/86/41686/2