From 28accc88c3fe8f110e31cadd895bb7fc71e0e226 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 18 Oct 2023 23:21:46 +0200 Subject: [PATCH] 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 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 --- pySim/ts_31_102.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py index c7a58f16..5afa2ef0 100644 --- a/pySim/ts_31_102.py +++ b/pySim/ts_31_102.py @@ -1331,10 +1331,10 @@ class DF_USIM_5GS(CardDF): # 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 @@ class DF_USIM_5GS(CardDF): 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),