From 7d86fe1d8aed6f4aafb0b450b8e28b2e7cc3949e Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Wed, 19 Jul 2023 15:58:45 +0200 Subject: [PATCH] apdu/ts_102_221: extract channel number from dict before calling del_lchan When the method del_lchan is called, closed_channel_nr still contains a dict that contains the channel number under the key 'logical_channel_number'. This will lead to an exception. We must extact the channel number from the dict before we can use it with del_lchan. (See also created_channel_nr) Related: OS#6094 Change-Id: I399856bc227f17b66cdb4158a69a35d50ba222a7 --- pySim/apdu/ts_102_221.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py index 3780c8a8..2d3ad82f 100644 --- a/pySim/apdu/ts_102_221.py +++ b/pySim/apdu/ts_102_221.py @@ -396,7 +396,7 @@ class ManageChannel(ApduCommand, n='MANAGE CHANNEL', ins=0x70, cla=['0X', '4X', self.col_id = '%02u' % created_channel_nr return {'mode': mode, 'created_channel': created_channel_nr } elif mode == 'close_channel': - closed_channel_nr = self.cmd_dict['p2'] + closed_channel_nr = self.cmd_dict['p2']['logical_channel_number'] rs.del_lchan(closed_channel_nr) self.col_id = '%02u' % closed_channel_nr return {'mode': mode, 'closed_channel': closed_channel_nr }