laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28767 )
Change subject: apdu/ts_102_221: Fix SELECT of 3f00 ......................................................................
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 --- M pySim/apdu/ts_102_221.py 1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/67/28767/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 0ca6702..3597db8 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -63,9 +63,10 @@ lchan.selected_adf = sels['ADF.USIM'] lchan.selected_file = lchan.selected_adf #print("\tSELECT CUR_ADF %s" % lchan.selected_file) + # iterate to next element in path continue else: - sels = lchan.selected_file.get_selectables(['FIDS']) + sels = lchan.selected_file.get_selectables(['FIDS','MF']) if file_hex in sels: if self.successful: #print("\tSELECT %s" % sels[file_hex]) @@ -73,12 +74,13 @@ else: #print("\tSELECT %s FAILED" % sels[file_hex]) pass + # iterate to next element in path continue 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': if len(self.cmd_data) != 2: 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) if file_hex in sels: if self.successful: