From bf0689a48e774919c97f12e24cc9ae6a88169f58 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 7 Sep 2024 14:40:00 +0200 Subject: [PATCH] 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 --- pySim/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pySim/app.py b/pySim/app.py index 5525cd1f..5a93f986 100644 --- a/pySim/app.py +++ b/pySim/app.py @@ -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