mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-04-01 01:37:36 +03:00
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
This commit is contained in:
@@ -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]
|
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
|
ret['file_descriptor']['file_type'] = file_type
|
||||||
if file_type in ['mf', 'df']:
|
if file_type in ['mf', 'df']:
|
||||||
ret['file_characteristics'] = b2h(resp_bin[13])
|
ret['file_characteristics'] = b2h(resp_bin[13:14])
|
||||||
ret['num_direct_child_df'] = int(resp_bin[14], 16)
|
ret['num_direct_child_df'] = resp_bin[14]
|
||||||
ret['num_direct_child_ef'] = int(resp_bin[15], 16)
|
ret['num_direct_child_ef'] = resp_bin[15]
|
||||||
ret['num_chv_unblock_adm_codes'] = int(resp_bin[16])
|
ret['num_chv_unblock_adm_codes'] = int(resp_bin[16])
|
||||||
# CHV / UNBLOCK CHV stats
|
# CHV / UNBLOCK CHV stats
|
||||||
elif file_type in ['working_ef']:
|
elif file_type in ['working_ef']:
|
||||||
|
|||||||
Reference in New Issue
Block a user