laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34813?usp=email )


Change subject: ts_31_102: Fix initialization of file size
......................................................................

ts_31_102: Fix initialization of file size

We were using positional arguments when instantiating instances
of classes like EF_5GS3GPPLOCI with non-default names/fids/...

However, we got the argument order wrong and were passing the
description string in the position of the file size, which causes
exceptions like the following from pySim-trace:

Traceback (most recent call last):
  File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 198, in 
<module>
    tracer.main()
  File "/home/laforge/projects/git/pysim/./pySim-trace.py", line 125, in main
    inst.process(self.rs)
  File "/home/laforge/projects/git/pysim/pySim/apdu/__init__.py", line 259, in 
process
    self.processed = method(self.lchan)
  File "/home/laforge/projects/git/pysim/pySim/apdu/ts_102_221.py", line 152, 
in process_on_lchan
    if self.cmd_dict['offset'] != 0 or self.lr < self.file.size[0]:
TypeError: '<' not supported between instances of 'int' and 'str'

Let's use named initializers for any arguments after the usual "fid, sfid, name"
initial arguments.

Change-Id: I7f32c9fd01094620b68b0e54536ecc6cdbe67903
---
M pySim/ts_31_102.py
1 file changed, 33 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/13/34813/1

diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index c7a58f1..5afa2ef 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -1331,10 +1331,10 @@
             # I'm looking at 31.102 R16.6
             EF_5GS3GPPLOCI(service=122),
             EF_5GS3GPPLOCI('4f02', 0x02, 'EF.5GSN3GPPLOCI',
-                           '5GS non-3GPP location information', service=122),
+                           desc='5GS non-3GPP location information', 
service=122),
             EF_5GS3GPPNSC(service=122),
             EF_5GS3GPPNSC('4f04', 0x04, 'EF.5GSN3GPPNSC',
-                          '5GS non-3GPP Access NAS Security Context', 
service=122),
+                          desc='5GS non-3GPP Access NAS Security Context', 
service=122),
             EF_5GAUTHKEYS(service=123),
             EF_UAC_AIC(service=126),
             EF_SUCI_Calc_Info(service=124),
@@ -1342,7 +1342,7 @@
             EF_SUPI_NAI(service=130),
             EF_Routing_Indicator(service=124),
             TransparentEF('4F0B', 0x0b, 'EF.URSP',
-                          'UE Route Selector Policies per PLMN', service=132),
+                          desc='UE Route Selector Policies per PLMN', 
service=132),
             EF_TN3GPPSNN(service=133),
             # Rel-17 additions below
             EF_CAG(service=137),

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34813?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: I7f32c9fd01094620b68b0e54536ecc6cdbe67903
Gerrit-Change-Number: 34813
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>
Gerrit-MessageType: newchange

Reply via email to