aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2023-12-21 20:58:56 +0100
committerHarald Welte <laforge@osmocom.org>2024-01-04 21:27:39 +0100
commit4fe7de85682de0a1277325df8372e0c8a8f07dcc (patch)
treee2b605a61b1dd1f31941df1ba4686e669bcc9d0c
parentb0c9ccba66ebe861a7ff8b18e2f778a0d365670b (diff)
ts_31_103: Add construct for EF.GBABP and EF.GBANL
-rw-r--r--pySim/ts_31_103.py12
-rw-r--r--pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok2
2 files changed, 13 insertions, 1 deletions
diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py
index df91ea1..e9275c5 100644
--- a/pySim/ts_31_103.py
+++ b/pySim/ts_31_103.py
@@ -156,11 +156,23 @@ class EF_PCSCF(LinFixedEF):
class EF_GBABP(TransparentEF):
def __init__(self, fid='6fd5', sfid=None, name='EF.GBABP', desc='GBA Bootstrapping', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+ self._construct = Struct('rand'/LV,
+ 'b_tid'/LV,
+ 'key_lifetime'/LV)
# TS 31.103 Section 4.2.10
class EF_GBANL(LinFixedEF):
+ class NAF_ID(BER_TLV_IE, tag=0x80):
+ _construct = Struct('fqdn'/Utf8Adapter(Bytes(this._.total_len-5)),
+ 'ua_spi'/HexAdapter(Bytes(5)))
+ class B_TID(BER_TLV_IE, tag=0x81):
+ _construct = Utf8Adapter(GreedyBytes)
+ # pylint: disable=undefined-variable
+ class GbaNlCollection(TLV_IE_Collection, nested=[NAF_ID, B_TID]):
+ pass
def __init__(self, fid='6fd7', sfid=None, name='EF.GBANL', desc='GBA NAF List', **kwargs):
super().__init__(fid=fid, sfid=sfid, name=name, desc=desc, **kwargs)
+ self._tlv = EF_GBANL.GbaNlCollection
# TS 31.103 Section 4.2.11
class EF_NAFKCA(LinFixedEF):
diff --git a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
index 2d9d951..047f9de 100644
--- a/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
+++ b/pysim-testdata/pySim-trace_test_gsmtap.pcapng.ok
@@ -347,7 +347,7 @@ CardReset(3b9f96801f878031e073fe211b674a4c753034054ba9)
===============================
01 READ BINARY MF/ADF.ISIM/EF.IST - 9000 {1: {'activated': True, 'description': 'P-CSCF address'}, 2: {'activated': False, 'description': 'Generic Bootstrapping Architecture (GBA)'}, 3: {'activated': False, 'description': 'HTTP Digest'}, 4: {'activated': True, 'description': 'GBA-based Local Key Establishment Mechanism'}, 5: {'activated': True, 'description': 'Support of P-CSCF discovery for IMS Local Break Out'}, 6: {'activated': False, 'description': 'Short Message Storage (SMS)'}, 7: {'activated': False, 'description': 'Short Message Status Reports (SMSR)'}, 8: {'activated': False, 'description': 'Support for SM-over-IP including data download via SMS-PP as defined in TS 31.111 [31]'}, 9: {'activated': False, 'description': 'Communication Control for IMS by ISIM'}, 10: {'activated': True, 'description': 'Support of UICC access to IMS'}, 11: {'activated': False, 'description': 'URI support by UICC'}, 12: {'activated': False, 'description': 'Media Type support'}, 13: {'activated': False, 'description': 'IMS call disconnection cause'}, 14: {'activated': False, 'description': 'URI support for MO SHORT MESSAGE CONTROL'}, 15: {'activated': False, 'description': 'MCPTT'}, 16: {'activated': False, 'description': 'URI support for SMS-PP DOWNLOAD as defined in 3GPP TS 31.111 [31]'}, 17: {'activated': False, 'description': 'From Preferred'}, 18: {'activated': False, 'description': 'IMS configuration data'}, 19: {'activated': False, 'description': 'XCAP Configuration Data'}, 20: {'activated': False, 'description': 'WebRTC URI'}, 21: {'activated': False, 'description': 'MuD and MiD configuration data'}, 22: {'activated': False}, 23: {'activated': False}, 24: {'activated': False}}
===============================
-01 READ BINARY MF/ADF.ISIM/EF.GBABP - 9000 {'raw': 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}
+01 READ BINARY MF/ADF.ISIM/EF.GBABP - 9000 None
===============================
01 READ RECORD MF/ADF.ISIM/EF.IMPU 02 9000 {'impu': None}
===============================