aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-12-23 21:01:39 +0100
committerlaforge <laforge@osmocom.org>2023-12-27 15:15:54 +0000
commit2538dd7621d4aac9956735b3187487520c4f7827 (patch)
tree1db5e037d77bd9b4aaf8b7fbff74ebb9236e1c42
parentee6a95177496dfae9c890136745d00b809803a62 (diff)
global_platform: Correctly decode Key Information Data
The list contains tuples of (key_type, key_length). Let's fix that. Change-Id: Icf367827d62ed67afa27ee3d0ba9d5cd5bc65c99
-rw-r--r--pySim/global_platform.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/pySim/global_platform.py b/pySim/global_platform.py
index 136cccc..b564770 100644
--- a/pySim/global_platform.py
+++ b/pySim/global_platform.py
@@ -95,8 +95,9 @@ KeyType = Enum(Byte, des=0x80,
# c0 04 02038010
# c0 04 03038010
class KeyInformationData(BER_TLV_IE, tag=0xc0):
+ KeyTypeLen = Struct('type'/KeyType, 'length'/Int8ub)
_construct = Struct('key_identifier'/Byte, 'key_version_number'/Byte,
- 'key_types'/GreedyRange(KeyType))
+ 'key_types'/GreedyRange(KeyTypeLen))
class KeyInformation(BER_TLV_IE, tag=0xe0, nested=[KeyInformationData]):
pass