mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-25 06:48:33 +03:00
apdu/ts_102_221: Fix SELECT of 3f00
In order to be able to explicitly select the MF via 3f00, we need to pass the 'MF' to get_selectables(), so the record is included in the list of selectable files from the current working directory. Change-Id: I27085896142fe547a6e93e01e63e59bbc65c8b8a
This commit is contained in:
@@ -63,9 +63,10 @@ class UiccSelect(ApduCommand, n='SELECT', ins=0xA4, cla=['0X', '4X', '6X']):
|
|||||||
lchan.selected_adf = sels['ADF.USIM']
|
lchan.selected_adf = sels['ADF.USIM']
|
||||||
lchan.selected_file = lchan.selected_adf
|
lchan.selected_file = lchan.selected_adf
|
||||||
#print("\tSELECT CUR_ADF %s" % lchan.selected_file)
|
#print("\tSELECT CUR_ADF %s" % lchan.selected_file)
|
||||||
|
# iterate to next element in path
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
sels = lchan.selected_file.get_selectables(['FIDS'])
|
sels = lchan.selected_file.get_selectables(['FIDS','MF'])
|
||||||
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])
|
||||||
@@ -73,12 +74,13 @@ class UiccSelect(ApduCommand, n='SELECT', ins=0xA4, cla=['0X', '4X', '6X']):
|
|||||||
else:
|
else:
|
||||||
#print("\tSELECT %s FAILED" % sels[file_hex])
|
#print("\tSELECT %s FAILED" % sels[file_hex])
|
||||||
pass
|
pass
|
||||||
|
# iterate to next element in path
|
||||||
continue
|
continue
|
||||||
logger.warning('SELECT UNKNOWN FID %s (%s)' % (file_hex, '/'.join([b2h(x) for x in path])))
|
logger.warning('SELECT UNKNOWN FID %s (%s)' % (file_hex, '/'.join([b2h(x) for x in path])))
|
||||||
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'])
|
sels = lchan.selected_file.get_selectables(['FIDS','MF'])
|
||||||
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:
|
||||||
|
|||||||
Reference in New Issue
Block a user