diff options
authorPhilipp Maier <pmaier@sysmocom.de>2021-03-01 14:28:07 +0100
committerHarald Welte <laforge@osmocom.org>2021-03-05 21:42:52 +0100
commitdf848a167ba68f85cc8e04e6a955817fb1a29687 (patch)
parent058e11ae7e95ed318dc2208e05aa1945cb28b5eb (diff)
ts_102_221: fix fixup_fcp_proprietary_tlv_map()laforge/shell2
According to its description, the function fixup_fcp_proprietary_tlv_map() is supposed to add propritary TLV tags to satisfy the pyTlv parser, which can't handle unexpected tags. However, the function adds tags but it does only fill up the gaps from 0xd0 onwards. This makes no sense, lets extended it so that it adds a propritary tag for each tag that it is not already in the dictionary so that we get a continious dictionary that starts at 0x00 and ends at 0xff Change-Id: Ib06041361851f05dd990576fff47048dc1aa6290 Related: OS#4963
1 files changed, 4 insertions, 5 deletions
diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py
index 256a697..e3e7052 100644
--- a/pySim/ts_102_221.py
+++ b/pySim/ts_102_221.py
@@ -126,13 +126,12 @@ FCP_prorietary_interpreter_map = {
# accept unknown tags. It also doesn't raise a specific exception type but
# just the generic ValueError, so we cannot ignore those either. Instead,
# we insert a dict entry for every possible proprietary tag permitted
+#def fixup_fcp_proprietary_tlv_map(tlv_map):
def fixup_fcp_proprietary_tlv_map(tlv_map):
- if 'D0' in tlv_map:
- return
- for i in range(0xd0, 0xff):
+ for i in range(0x00, 0xff):
i_hex = i2h([i]).upper()
- tlv_map[i_hex] = 'proprietary_' + i_hex
+ if i_hex not in tlv_map:
+ tlv_map[i_hex] = 'proprietary_' + i_hex
def tlv_key_replace(inmap, indata):
def newkey(inmap, key):