apdu/ts_102_221: SELECT: allow select of SELF

While in the pySim-shell, it's useful to filter the currently selected
file from the choice of available files for select, this doesn't apply
for the tracing case: It's perfectly valid for the UE to SELECT the
file that's already selected right now.  The operation basically
becomes equivalent to a STATUS.

Change-Id: I1a20fb3ba70426333ac34448c6cb782c51363965
This commit is contained in:
Harald Welte 2022-07-24 12:23:56 +02:00
parent dcc689d9c4
commit 93c34aac89
1 changed files with 2 additions and 2 deletions

View File

@ -66,7 +66,7 @@ class UiccSelect(ApduCommand, n='SELECT', ins=0xA4, cla=['0X', '4X', '6X']):
# iterate to next element in path # iterate to next element in path
continue continue
else: else:
sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT']) sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT','SELF'])
if file_hex in sels: if file_hex in sels:
if self.successful: if self.successful:
#print("\tSELECT %s" % sels[file_hex]) #print("\tSELECT %s" % sels[file_hex])
@ -80,7 +80,7 @@ class UiccSelect(ApduCommand, n='SELECT', ins=0xA4, cla=['0X', '4X', '6X']):
elif mode == 'df_ef_or_mf_by_file_id': elif mode == 'df_ef_or_mf_by_file_id':
if len(self.cmd_data) != 2: if len(self.cmd_data) != 2:
raise ValueError('Expecting a 2-byte FID') raise ValueError('Expecting a 2-byte FID')
sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT']) sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT','SELF'])
file_hex = b2h(self.cmd_data) file_hex = b2h(self.cmd_data)
if file_hex in sels: if file_hex in sels:
if self.successful: if self.successful: