pySim.app: Properly reset card state after reading EID

The code had two problems:

* the RESET was only performed in the successful case, but not if
  some exceptio was raised

* the RESET was a low-level reset bypassing the RuntimeState,
  so the lchan.selected_file was stale afterwards

Fixes: Change-Id Idc2ea1d9263f39b3dff403e1535a5e6c4e88b26f

Change-Id: Ib23d3d5b58b456a25157a622c1010c81cd8b2213
This commit is contained in:
Harald Welte
2024-09-07 14:40:00 +02:00
parent 726097e51f
commit bf0689a48e

View File

@@ -116,6 +116,7 @@ def init_card(sl: LinkBase) -> Tuple[RuntimeState, SimCardBase]:
except SwMatchError:
# has ISD-R but not a SGP.22/SGP.32 eUICC - maybe SGP.02?
pass
card.reset()
finally:
rs.reset()
return rs, card