lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

July 2024

  • 1 participants
  • 1379 discussions
[S] Change in osmo-ci[master]: OBS: support epoch in strongswan-epdg version
by osmith 29 Jul '24

29 Jul '24
osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/37649?usp=email ) Change subject: OBS: support epoch in strongswan-epdg version ...................................................................... OBS: support epoch in strongswan-epdg version In the related commit, an epoch has been added to the strongswan-epdg version. Adjust the code that replaces the version to suppor this. Related: https://gitea.osmocom.org/ims-volte-vowifi/strongswan-epdg/commit/872be0a93… Change-Id: I7abcf82a78fd4c4f6d29d2717dad5c70bc50e683 --- M scripts/obs/lib/debian.py 1 file changed, 14 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved diff --git a/scripts/obs/lib/debian.py b/scripts/obs/lib/debian.py index 91c9dac..3c0c2a5 100644 --- a/scripts/obs/lib/debian.py +++ b/scripts/obs/lib/debian.py @@ -113,7 +113,7 @@ pass # Debian versions must start with a digit - if version.startswith("osmo-epdg-"): + if "osmo-epdg-" in version: version = f"{version.replace('osmo-epdg-', '', 1)}-osmo-epdg" version = version.replace("-", ".") -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/37649?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I7abcf82a78fd4c4f6d29d2717dad5c70bc50e683 Gerrit-Change-Number: 37649 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-ci[master]: OBS: fix up-to-date check for strongswan-epdg
by fixeria 29 Jul '24

29 Jul '24
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/37650?usp=email ) Change subject: OBS: fix up-to-date check for strongswan-epdg ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/37650?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I515695d52f5d37b256ef163875417745897e5900 Gerrit-Change-Number: 37650 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 11:38:42 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: OBS: support epoch in strongswan-epdg version
by fixeria 29 Jul '24

29 Jul '24
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/37649?usp=email ) Change subject: OBS: support epoch in strongswan-epdg version ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/37649?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I7abcf82a78fd4c4f6d29d2717dad5c70bc50e683 Gerrit-Change-Number: 37649 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 11:38:12 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: OBS: replace - with . in version for d/changelog
by fixeria 29 Jul '24

29 Jul '24
Attention is currently required from: osmith. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/37648?usp=email ) Change subject: OBS: replace - with . in version for d/changelog ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/37648?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: If00469689b107efdf91a5cee4ebe6a3ccc183cec Gerrit-Change-Number: 37648 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 29 Jul 2024 11:37:46 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in pysim[master]: pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37660?usp=email ) Change subject: pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip ...................................................................... pySim.esim.saip: Add subclasses for gsm-access, phonebook, 5gs, saip Those are all optional ProfileElements related to the USIM NAA. Change-Id: I621cc3d2440babdc11b4b038f16acf418bbc88ad --- M pySim/esim/saip/__init__.py 1 file changed, 63 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/37660/1 diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index 9185e36..81fef84 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -296,13 +296,13 @@ 'opt-usim': ProfileElementOptUSIM, 'isim': ProfileElementISIM, 'opt-isim': ProfileElementOptISIM, - # TODO: phonebook - # TODO: gsm-access + 'phonebook': ProfileElementPhonebook, + 'gsm-access': ProfileElementGsmAccess, # TODO: csim # TODO: opt-csim # TODO: eap - # TODO: df-5gs - # TODO: df-saip + 'df-5gs': ProfileElementDf5GS, + 'df-saip': ProfileElementDfSAIP, } if pe_type in class4petype: return class4petype[pe_type] @@ -517,6 +517,54 @@ for fname in ['df-telecom', 'ef-arr']: self.decoded[fname] = [] +class ProfileElementPhonebook(FsProfileElement): + type = 'phonebook' + + def __init__(self, decoded: Optional[dict] = None): + super().__init__(decoded) + if decoded: + return + # provide some reasonable defaults + self.decoded['templateID'] = str(oid.DF_PHONEBOOK_ADF_USIM) + for fname in ['df-phonebook']: + self.decoded[fname] = [] + +class ProfileElementGsmAccess(FsProfileElement): + type = 'gsm-access' + + def __init__(self, decoded: Optional[dict] = None): + super().__init__(decoded) + if decoded: + return + # provide some reasonable defaults + self.decoded['templateID'] = str(oid.DF_GSM_ACCESS_ADF_USIM) + for fname in ['df-gsm-access']: + self.decoded[fname] = [] + +class ProfileElementDf5GS(FsProfileElement): + type = 'df-5gs' + + def __init__(self, decoded: Optional[dict] = None): + super().__init__(decoded) + if decoded: + return + # provide some reasonable defaults + self.decoded['templateID'] = str(oid.DF_5GS_v3) + for fname in ['df-5gs']: + self.decoded[fname] = [] + +class ProfileElementDfSAIP(FsProfileElement): + type = 'df-saip' + + def __init__(self, decoded: Optional[dict] = None): + super().__init__(decoded) + if decoded: + return + # provide some reasonable defaults + self.decoded['templateID'] = str(oid.DF_SAIP) + for fname in ['df-saip']: + self.decoded[fname] = [] + class SecurityDomainKeyComponent: """Representation of a key-component of a key for a security domain.""" -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37660?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I621cc3d2440babdc11b4b038f16acf418bbc88ad Gerrit-Change-Number: 37660 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.ts_102_221: Fix FileDescriptor encoding for BER-TLV case
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37653?usp=email ) Change subject: pySim.ts_102_221: Fix FileDescriptor encoding for BER-TLV case ...................................................................... pySim.ts_102_221: Fix FileDescriptor encoding for BER-TLV case This fixes a long-standing bug in the FileDescriptor IE class which so far only supported decoding, but not encoding of BER-TLV file descriptors. Change-Id: I598b0e1709ee004bcf01a53beb91f68470e1f3da --- M pySim/ts_102_221.py 1 file changed, 18 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/53/37653/1 diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py index 1b40b09..5661cf4 100644 --- a/pySim/ts_102_221.py +++ b/pySim/ts_102_221.py @@ -94,24 +94,20 @@ # ETSI TS 102 221 11.1.1.4.3 class FileDescriptor(BER_TLV_IE, tag=0x82): - _test_decode = [ - # FIXME: this doesn't work as _encode test for some strange reason. - ( '82027921', { "file_descriptor_byte": { "shareable": True, "structure": "ber_tlv" }, "record_len": None, "num_of_rec": None } ), - ] _test_de_encode = [ + ( '82027921', { "file_descriptor_byte": { "shareable": True, "structure": "ber_tlv" }, "record_len": None, "num_of_rec": None } ), ( '82027821', { "file_descriptor_byte": { "shareable": True, "file_type": "df", "structure": "no_info_given" }, "record_len": None, "num_of_rec": None }), ( '82024121', { "file_descriptor_byte": { "shareable": True, "file_type": "working_ef", "structure": "transparent" }, "record_len": None, "num_of_rec": None } ), ( '82054221006e05', { "file_descriptor_byte": { "shareable": True, "file_type": "working_ef", "structure": "linear_fixed" }, "record_len": 110, "num_of_rec": 5 } ), ] class BerTlvAdapter(Adapter): - def _parse(self, obj, context, path): - data = obj.read() - if data == b'\x01\x01\x01\x00\x00\x01': + def _decode(self, obj, context, path): + if obj == 0x39: return 'ber_tlv' raise ValidationError - def _build(self, obj, context, path): + def _encode(self, obj, context, path): if obj == 'ber_tlv': - return b'\x01\x01\x01\x00\x00\x01' + return 0x39 raise ValidationError FDB = Select(BitStruct(Const(0, Bit), 'shareable'/Flag, 'structure'/BerTlvAdapter(Const(0x39, BitsInteger(6)))), -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37653?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I598b0e1709ee004bcf01a53beb91f68470e1f3da Gerrit-Change-Number: 37653 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.filesystem: Add Path for abstraction/utility around file system...
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37652?usp=email ) Change subject: pySim.filesystem: Add Path for abstraction/utility around file system paths ...................................................................... pySim.filesystem: Add Path for abstraction/utility around file system paths Change-Id: I202baa378988431a318850e3593ff1929d94d268 --- M pySim/filesystem.py 1 file changed, 55 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/52/37652/1 diff --git a/pySim/filesystem.py b/pySim/filesystem.py index 5414fb9..0c7d51d 100644 --- a/pySim/filesystem.py +++ b/pySim/filesystem.py @@ -9,7 +9,7 @@ not the actual contents / runtime state of interacting with a given smart card. """ -# (C) 2021 by Harald Welte <laforge(a)osmocom.org> +# (C) 2021-2024 by Harald Welte <laforge(a)osmocom.org> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -1448,3 +1448,48 @@ for m in CardModel.__subclasses__(): if m.match(scc): m.add_files(rs) + + +class Path: + """Representation of a file-system path.""" + def __init__(self, p: Union[str, List[str]]): + # split if given as single string with slahes + if isinstance(p, str): + p = p.split('/') + # make sure internal representation alwas is uppercase only + self.list = [x.upper() for x in p] + + def __str__(self) -> str: + return '/'.join(self.list) + + def __repr__(self) -> str: + return 'Path(%s)' % (str(self)) + + def __eq__(self, other: 'Path') -> bool: + return self.list == other.list + + def __getitem__(self, i): + return self.list[i] + + def __add__(self, a): + if isinstance(a, list): + l = self.list + a + elif isinstance(a, Path): + l = self.list + a.list + else: + l = self.list + [a] + return Path(l) + + def relative_to_mf(self) -> 'Path': + """Return a path relative to MF, i.e. without initial explicit MF.""" + if self.list[0] == 'MF': + return Path(self.list[1:]) + return self + + def is_parent(self, other: 'Path') -> bool: + """Is this instance a parent of the given other instance?""" + if len(self.list) >= len(other.list): + return False + if other.list[:len(self.list)] == self.list: + return True + return False -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37652?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I202baa378988431a318850e3593ff1929d94d268 Gerrit-Change-Number: 37652 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.ts_102_221: Add ProprietaryInformation sub-IEs of TS 102 222
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37654?usp=email ) Change subject: pySim.ts_102_221: Add ProprietaryInformation sub-IEs of TS 102 222 ...................................................................... pySim.ts_102_221: Add ProprietaryInformation sub-IEs of TS 102 222 We put those in ts_102_221 because that's where ProprietaryInformation is defined, and we don't want to risk circular dependencies. Change-Id: I526acfeacee9e4f7118f280b3549fd04fdb74336 --- M pySim/ts_102_221.py 1 file changed, 36 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/54/37654/1 diff --git a/pySim/ts_102_221.py b/pySim/ts_102_221.py index 5661cf4..211bf68 100644 --- a/pySim/ts_102_221.py +++ b/pySim/ts_102_221.py @@ -169,17 +169,40 @@ class Platform2PlatformCatSecuredApdu(BER_TLV_IE, tag=0x89): _construct = GreedyBytes +# TS 102 222 Table 4a + 5 +class SpecialFileInfo(BER_TLV_IE, tag=0xC0): + _construct = FlagsEnum(Byte, high_update_activity=0x80, readable_and_updatable_when_deactivated=0x40) + +# TS 102 222 Table 4a +class FillingPattern(BER_TLV_IE, tag=0xC1): + # The first W-1 bytes of the transparent EF or the first W-1 bytes of each record of a record + # oriented EF shall be initialized with the first W-1 bytes of the Filling Pattern. All remaining + # bytes (if any) shall be initialized with the value of the last byte of the Filling Pattern. If + # the file or record length is shorter than the Filling Pattern, the Filling Pattern shall be + # truncated accordingly. + _construct = GreedyBytes + +# TS 102 222 Table 4a +class RepeatPattern(BER_TLV_IE, tag=0xC2): + # The first X bytes of the transparent EF or the first X bytes of each record of a record oriented + # EF shall be initialized with the X bytes of the Repeat Pattern. This shall be repeated + # consecutively for all remaining blocks of X bytes of data in the file or in a record. If + # necessary, the Repeat Pattern shall be truncated at the end of the file or at the end of each + # record to initialize the remaining bytes. + _construct = GreedyBytes + # sysmoISIM-SJA2 specific class ToolkitAccessConditions(BER_TLV_IE, tag=0xD2): _construct = FlagsEnum(Byte, rfm_create=1, rfm_delete_terminate=2, other_applet_create=4, other_applet_delete_terminate=8) -# ETSI TS 102 221 11.1.1.4.6.0 +# ETSI TS 102 221 11.1.1.4.6.0 + TS 102 222 Table 4A class ProprietaryInformation(BER_TLV_IE, tag=0xA5, nested=[UiccCharacteristics, ApplicationPowerConsumption, MinApplicationClockFrequency, AvailableMemory, FileDetails, ReservedFileSize, MaximumFileSize, SupportedFilesystemCommands, SpecificUiccEnvironmentConditions, + SpecialFileInfo, FillingPattern, RepeatPattern, ToolkitAccessConditions]): pass -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37654?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I526acfeacee9e4f7118f280b3549fd04fdb74336 Gerrit-Change-Number: 37654 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in pysim[master]: pySim.commands: make use of status word interpreter for CHV
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37651?usp=email ) Change subject: pySim.commands: make use of status word interpreter for CHV ...................................................................... pySim.commands: make use of status word interpreter for CHV Related: OS#6398 Change-Id: I71efe9d6804c4845bb81f1b3b443215dad0ac301 --- M pySim/commands.py 1 file changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/37651/1 diff --git a/pySim/commands.py b/pySim/commands.py index 3f659eb..43fc705 100644 --- a/pySim/commands.py +++ b/pySim/commands.py @@ -679,7 +679,7 @@ raise RuntimeError('Failed to %s chv_no 0x%02X with code 0x%s, %i tries left.' % (op_name, chv_no, b2h(pin_code).upper(), int(sw[3]))) if sw != '9000': - raise SwMatchError(sw, '9000') + raise SwMatchError(sw, '9000', self._tp.sw_interpreter) def verify_chv(self, chv_no: int, code: Hexstr) -> ResTuple: """Verify a given CHV (Card Holder Verification == PIN) -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37651?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I71efe9d6804c4845bb81f1b3b443215dad0ac301 Gerrit-Change-Number: 37651 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in pysim[master]: pySim.esim.saip: Initial support for parsing GenericFileManagement
by laforge 29 Jul '24

29 Jul '24
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37655?usp=email ) Change subject: pySim.esim.saip: Initial support for parsing GenericFileManagement ...................................................................... pySim.esim.saip: Initial support for parsing GenericFileManagement Change-Id: I4a92f5849158a59f6acca05121d38adc0a495906 --- M pySim/esim/saip/__init__.py 1 file changed, 65 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/55/37655/1 diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py index c76cb5c..6cddf3e 100644 --- a/pySim/esim/saip/__init__.py +++ b/pySim/esim/saip/__init__.py @@ -153,6 +153,10 @@ self.fileDescriptor.update(dict(fd)) self.stream = self.linearize_file_content(l) + def from_gfm(self, d: Dict): + print(d) + # FIXME + def to_tuples(self) -> List[Tuple]: """Generate a list of fileDescriptor, fillFileContent, fillFileOffset tuples into this instance.""" raise NotImplementedError @@ -277,6 +281,7 @@ 'opt-isim': ProfileElementOptISIM, 'akaParameter': ProfileElementAKA, 'header': ProfileElementHeader, + 'genericFileManagement': ProfileElementGFM, 'end': ProfileElementEnd, } """Construct an instance from given raw, DER encoded bytes.""" @@ -342,6 +347,57 @@ #self.files2pe() pass +class ProfileElementGFM(ProfileElement): + type = 'genericFileManagement' + + def __init__(self, decoded = None, mandated: bool = True): + super().__init__(decoded, mandated) + # indexed by PE-Name + self.files = {} + self.tdef = asn1.types['ProfileElement'].type.name_to_member[self.type] + + def add_file(self, path, file: File): + # FIXME: proper FS hiearchy + #if path in self.files: + # raise KeyError('Cannot add file: path %s already exists' % path) + self.files[path] = file + + def pe2files(self): + """Update the "files" member with the contents of the "decoded" member.""" + def perform(self, path, file_elements): + if len(file_elements): + file = File('', file_elements) + self.add_file(path, file) + + path = "3f00" # current DF: MF + file_elements = [] + # looks like TCA added one level too much in the ASN.1 hierarchy here + for fmc in self.decoded['fileManagementCMD']: + for fmc2 in fmc: + if fmc2[0] == 'filePath': + # selecting a new path means we're done with the previous file + perform(self, path, file_elements) + if fmc2[1] == "": + path = "3f00" + else: + # FIXME + pass + elif fmc2[0] == 'createFCP': + # new FCP means new file; perform the old one + perform(self, path, file_elements) + file_elements = [('fileDescriptor', fmc2[1])] + elif fmc2[0] == 'fillFileOffset' or fmc2[0] == 'fillFileContent': + file_elements.append(fmc2) + else: + raise ValueError("Unknown GFM choice '%s'" % fmc2[0]) + # add the last file, if we still have any pending data in file_elements + perform(self, path, file_elements) + + def _post_decode(self): + # not entirely sure about this automatism + self.pe2files() + + class ProfileElementMF(FsProfileElement): type = 'mf' -- To view, visit https://gerrit.osmocom.org/c/pysim/+/37655?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I4a92f5849158a59f6acca05121d38adc0a495906 Gerrit-Change-Number: 37655 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • ...
  • 138
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.