Use keyword argument for file description argument

While our base classes (TransparentEF / LinFixedEF) always have the
dsecription as 4th argument after "fid, sfid, name", most of the derived
file-specific classes do not share that same argument order.

As seen in the bug fixed by previous Change-Id I7f32c9fd01094620b68b0e54536ecc6cdbe67903
this can have serious consequences.  Let's avoid using unnamed
(positional) arguments for the description text altogether.

Change-Id: Icfb3fd1bae038c54fa14a91aa9f75219d839968c
This commit is contained in:
Harald Welte
2023-10-18 23:32:57 +02:00
parent 28accc88c3
commit 509ecf84fa
2 changed files with 56 additions and 57 deletions

View File

@@ -927,32 +927,32 @@ class DF_GSM(CardDF):
EF_Kc(),
EF_PLMNsel(),
TransparentEF('6f31', None, 'EF.HPPLMN',
'Higher Priority PLMN search period'),
desc='Higher Priority PLMN search period'),
EF_ACMmax(),
EF_ServiceTable('6f38', None, 'EF.SST',
'SIM service table', table=EF_SST_map, size=(2, 16)),
desc='SIM service table', table=EF_SST_map, size=(2, 16)),
CyclicEF('6f39', None, 'EF.ACM',
'Accumulated call meter', rec_len=(3, 3)),
TransparentEF('6f3e', None, 'EF.GID1', 'Group Identifier Level 1'),
TransparentEF('6f3f', None, 'EF.GID2', 'Group Identifier Level 2'),
desc='Accumulated call meter', rec_len=(3, 3)),
TransparentEF('6f3e', None, 'EF.GID1', desc='Group Identifier Level 1'),
TransparentEF('6f3f', None, 'EF.GID2', desc='Group Identifier Level 2'),
EF_SPN(),
TransparentEF('6f41', None, 'EF.PUCT',
'Price per unit and currency table', size=(5, 5)),
desc='Price per unit and currency table', size=(5, 5)),
EF_CBMI(),
TransparentEF('6f74', None, 'EF.BCCH',
'Broadcast control channels', size=(16, 16)),
desc='Broadcast control channels', size=(16, 16)),
EF_ACC(),
EF_PLMNsel('6f7b', None, 'EF.FPLMN',
'Forbidden PLMNs', size=(12, 12)),
desc='Forbidden PLMNs', size=(12, 12)),
EF_LOCI(),
EF_AD(),
TransparentEF('6fae', None, 'EF.Phase',
'Phase identification', size=(1, 1)),
desc='Phase identification', size=(1, 1)),
EF_VGCS(),
EF_VGCSS(),
EF_VGCS('6fb3', None, 'EF.VBS', 'Voice Broadcast Service'),
EF_VGCS('6fb3', None, 'EF.VBS', desc='Voice Broadcast Service'),
EF_VGCSS('6fb4', None, 'EF.VBSS',
'Voice Broadcast Service Status'),
desc='Voice Broadcast Service Status'),
EF_eMLPP(),
EF_AAeM(),
EF_CBMID(),
@@ -961,29 +961,29 @@ class DF_GSM(CardDF):
EF_DCK(),
EF_CNL(),
EF_NIA(),
EF_Kc('6f52', None, 'EF.KcGPRS', 'GPRS Ciphering key KcGPRS'),
EF_Kc('6f52', None, 'EF.KcGPRS', desc='GPRS Ciphering key KcGPRS'),
EF_LOCIGPRS(),
TransparentEF('6f54', None, 'EF.SUME', 'SetUpMenu Elements'),
TransparentEF('6f54', None, 'EF.SUME', desc='SetUpMenu Elements'),
EF_xPLMNwAcT('6f60', None, 'EF.PLMNwAcT',
'User controlled PLMN Selector with Access Technology'),
desc='User controlled PLMN Selector with Access Technology'),
EF_xPLMNwAcT('6f61', None, 'EF.OPLMNwAcT',
'Operator controlled PLMN Selector with Access Technology'),
desc='Operator controlled PLMN Selector with Access Technology'),
EF_xPLMNwAcT('6f62', None, 'EF.HPLMNwAcT',
'HPLMN Selector with Access Technology'),
desc='HPLMN Selector with Access Technology'),
EF_CPBCCH(),
EF_InvScan(),
EF_PNN(),
EF_OPL(),
EF_ADN('6fc7', None, 'EF.MBDN', 'Mailbox Dialling Numbers'),
EF_ADN('6fc7', None, 'EF.MBDN', desc='Mailbox Dialling Numbers'),
EF_MBI(),
EF_MWIS(),
EF_ADN('6fcb', None, 'EF.CFIS',
'Call Forwarding Indication Status'),
EF_EXT('6fc8', None, 'EF.EXT6', 'Externsion6 (MBDN)'),
EF_EXT('6fcc', None, 'EF.EXT7', 'Externsion7 (CFIS)'),
desc='Call Forwarding Indication Status'),
EF_EXT('6fc8', None, 'EF.EXT6', desc='Externsion6 (MBDN)'),
EF_EXT('6fcc', None, 'EF.EXT7', desc='Externsion7 (CFIS)'),
EF_SPDI(),
EF_MMSN(),
EF_EXT('6fcf', None, 'EF.EXT8', 'Extension8 (MMSN)'),
EF_EXT('6fcf', None, 'EF.EXT8', desc='Extension8 (MMSN)'),
EF_MMSICP(),
EF_MMSUP(),
EF_MMSUCP(),