From 3c309886e94f773b0c410f270898dc29e17c39d0 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Thu, 14 Oct 2021 17:55:04 +0200 Subject: [PATCH] ts_51_011: fix select response decoder The select response decoder is using b2h() wrongly. b2h expects a bytearray but we call it with an integer. In the following two lines we try to convert an integer to an integer. Change-Id: Ib6448d3bd7a0dc7f25e5ee82a42266b3313e2a95 --- pySim/ts_51_011.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 70629f7e..5d1197c1 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -937,9 +937,9 @@ def decode_select_response(resp_hex): file_type = type_of_file_map[resp_bin[6]] if resp_bin[6] in type_of_file_map else resp_bin[6] ret['file_descriptor']['file_type'] = file_type if file_type in ['mf', 'df']: - ret['file_characteristics'] = b2h(resp_bin[13]) - ret['num_direct_child_df'] = int(resp_bin[14], 16) - ret['num_direct_child_ef'] = int(resp_bin[15], 16) + ret['file_characteristics'] = b2h(resp_bin[13:14]) + ret['num_direct_child_df'] = resp_bin[14] + ret['num_direct_child_ef'] = resp_bin[15] ret['num_chv_unblock_adm_codes'] = int(resp_bin[16]) # CHV / UNBLOCK CHV stats elif file_type in ['working_ef']: