From 278816251d3201d233d169fd4fbde821f13624db Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 21 Apr 2021 11:16:31 +0200 Subject: [PATCH] filesystem.py: Introduce place-holder for BER-TLV files I always assumed BER-TLV files are transparent EF with BER-TLV contents. However, this is wrong. ETS TS 102 221 Section 8.2.2.4 specifies them. TS 102 221 Section 11.3 describes the specific RETRIEVE DATA, SET DATA commands, which are not yet implemented in pySim. Change-Id: Ie4701d9f72b05c8a5810e287e55a20f6ea86a574 --- pySim/filesystem.py | 6 ++++++ pySim/ts_31_103.py | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 1068930a..dec521e4 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -917,7 +917,13 @@ class TransRecEF(TransparentEF): return b''.join(chunks) +class BerTlvEF(TransparentEF): + """BER-TLV EF (Entry File) in the smart card filesystem. + A BER-TLV EF is a binary file with a BER (Basic Encoding Rules) TLV structure + NOTE: We currently don't really support those, this class is simply a wrapper + around TransparentEF as a place-holder, so we can already define EFs of BER-TLV + type without fully supporting them.""" class RuntimeState(object): diff --git a/pySim/ts_31_103.py b/pySim/ts_31_103.py index baa4d250..d5641b3c 100644 --- a/pySim/ts_31_103.py +++ b/pySim/ts_31_103.py @@ -146,12 +146,12 @@ class EF_UICCIARI(LinFixedEF): super().__init__(fid=fid, sfid=sfid, name=name, desc=desc) # TS 31.103 Section 4.2.18 -class EF_IMSConfigData(TransparentEF): +class EF_IMSConfigData(BerTlvEF): def __init__(self, fid='6ff8', sfid=None, name='EF.IMSConfigData', desc='IMS Configuration Data'): super().__init__(fid=fid, sfid=sfid, name=name, desc=desc) # TS 31.103 Section 4.2.19 -class EF_XCAPConfigData(TransparentEF): +class EF_XCAPConfigData(BerTlvEF): def __init__(self, fid='6ffc', sfid=None, name='EF.XCAPConfigData', desc='XCAP Configuration Data'): super().__init__(fid=fid, sfid=sfid, name=name, desc=desc) @@ -161,7 +161,7 @@ class EF_WebRTCURI(TransparentEF): super().__init__(fid=fid, sfid=sfid, name=name, desc=desc) # TS 31.103 Section 4.2.21 -class EF_MuDMiDConfigData(TransparentEF): +class EF_MuDMiDConfigData(BerTlvEF): def __init__(self, fid='6ffe', sfid=None, name='EF.MuDMiDConfigData', desc='MuD and MiD Configuration Data'): super().__init__(fid=fid, sfid=sfid, name=name, desc=desc)