Attention is currently required from: daniel.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email )
The change is no longer submittable: Code-Review is unsatisfied now.
Change subject: ipa: Ensure osmo_ipa_segmentation_cb sets msg->l2h to the payload data
......................................................................
Patch Set 1: Code-Review-2
(1 comment)
Patchset:
PS1:
* as there was only one patch added to master since the last release, we can directly make the release commit on top of master
* please don't change the Change-Id when backporting patches. you can merge patches with the same Change-Id into different branches, and then they show up in gerrit on the top right, so we can see that the same patch is already in master.
* as Pau noted, backported patches should be submitted together with the commit that bumps the release
(not your fault, the release docs + process are a bit complicated)
release commit on top of master: https://gerrit.osmocom.org/c/libosmo-netif/+/37682
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: rel-1.5.1
Gerrit-Change-Id: Id91cddf9948ca49abf092850fae3a8f17e445b45
Gerrit-Change-Number: 37673
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 01 Aug 2024 09:07:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: daniel, osmith.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email )
Change subject: ipa: Ensure osmo_ipa_segmentation_cb sets msg->l2h to the payload data
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/37673?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: rel-1.5.1
Gerrit-Change-Id: Id91cddf9948ca49abf092850fae3a8f17e445b45
Gerrit-Change-Number: 37673
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 01 Aug 2024 09:05:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: daniel, osmith.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/37674?usp=email )
Change subject: osmo_bsc_sigtran: Don't try to decode ipaccess_head a second time
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/37674?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: rel-1.12.1
Gerrit-Change-Id: I300bbab3c0215d52bc5f6232ace5c37a6613feb7
Gerrit-Change-Number: 37674
Gerrit-PatchSet: 1
Gerrit-Owner: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: daniel <dwillmann(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 01 Aug 2024 09:05:41 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37658?usp=email )
Change subject: pySim.esim.saip.templates: Build tree from template files
......................................................................
pySim.esim.saip.templates: Build tree from template files
Change-Id: I13e80e9dbddbb145411378a0d9e01461aef75db4
---
M pySim/esim/saip/templates.py
1 file changed, 60 insertions(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/esim/saip/templates.py b/pySim/esim/saip/templates.py
index 417c83b..8a19d34 100644
--- a/pySim/esim/saip/templates.py
+++ b/pySim/esim/saip/templates.py
@@ -59,23 +59,69 @@
return "FileTemplate(%s/%s, %s, %s, arr=%s, sfi=%s)" % (self.name, self.pe_name, s_fid,
self.file_type, s_arr, s_sfi)
+ def print_tree(self, indent:str = ""):
+ """recursive printing of FileTemplate tree structure."""
+ print("%s%s" % (indent, repr(self)))
+ indent += " "
+ for c in self.children:
+ c.print_tree(indent)
+
+ def get_file_by_path(self, path: List[str]) -> Optional['FileTemplate']:
+ """Return a FileTemplate matching the given path within this ProfileTemplate."""
+ if path[0].lower() != self.name.lower():
+ return None
+ for c in self.children:
+ if path[1].lower() == c.name.lower():
+ return c.get_file_by_path(path[1:])
+
class ProfileTemplate:
"""Representation of a SimAlliance/TCA Profile Template. Each Template is identified by its OID and
consists of a number of file definitions. We implement each profile template as a class derived from this
base class. Each such derived class is a singleton and has no instances."""
created_by_default: bool = False
+ optional: bool = False
oid: Optional[OID.eOID] = None
files: List[FileTemplate] = []
- files_by_pename: dict[str,FileTemplate] = {}
def __init_subclass__(cls, **kwargs):
"""This classmethod is called automatically after executing the subclass body. We use it to
initialize the cls.files_by_pename from the cls.files"""
super().__init_subclass__(**kwargs)
+ cur_df = None
+
+ cls.files_by_pename: dict[str,FileTemplate] = {}
+ cls.tree: List[FileTemplate] = []
+
+ if not cls.optional and not cls.files[0].file_type in ['MF', 'DF', 'ADF']:
+ raise ValueError('First file in non-optional template must be MF, DF or ADF (is: %s)' % cls.files[0])
for f in cls.files:
+ if f.file_type in ['MF', 'DF', 'ADF']:
+ if cur_df == None:
+ cls.tree.append(f)
+ cur_df = f
+ f.parent = None
+ else:
+ # "cd .."
+ if cur_df.parent:
+ cur_df = cur_df.parent
+ cur_df.children.append(f)
+ f.parent = cur_df
+ cur_df = f
+ else:
+ if cur_df == None:
+ cls.tree.append(f)
+ f.parent = None
+ else:
+ cur_df.children.append(f)
+ f.parent = cur_df
cls.files_by_pename[f.pe_name] = f
ProfileTemplateRegistry.add(cls)
+ @classmethod
+ def print_tree(cls):
+ for c in cls.tree:
+ c.print_tree()
+
class ProfileTemplateRegistry:
"""A registry of profile templates. Exists as a singleton class with no instances and only
classmethods."""
@@ -318,6 +364,7 @@
# Section 9.5.2 v2.3.1
class FilesUsimOptional(ProfileTemplate):
created_by_default = False
+ optional = True
oid = OID.ADF_USIMopt_not_by_default
files = [
FileTemplate(0x6f05, 'EF.LI', 'TR', None, 6, 1, 0x02, 'FF...FF', False),
@@ -400,6 +447,7 @@
# Section 9.5.2
class FilesUsimOptionalV2(ProfileTemplate):
created_by_default = False
+ optional = True
oid = OID.ADF_USIMopt_not_by_default_v2
files = [
FileTemplate(0x6f05, 'EF.LI', 'TR', None, 6, 1, 0x02, 'FF...FF', False),
@@ -601,6 +649,7 @@
# Section 9.6.2 v2.3.1
class FilesIsimOptional(ProfileTemplate):
created_by_default = False
+ optional = True
oid = OID.ADF_ISIMopt_not_by_default
files = [
FileTemplate(0x6f09, 'EF.P-CSCF', 'LF', 1, None, 2, None, None, True, ['size'], ass_serv=[1,5]),
@@ -618,6 +667,7 @@
# Section 9.6.2
class FilesIsimOptionalv2(ProfileTemplate):
created_by_default = False
+ optional = True
oid = OID.ADF_ISIMopt_not_by_default_v2
files = [
FileTemplate(0x6f09, 'EF.PCSCF', 'LF', 1, None, 2, None, None, True, ['size'], ass_serv=[1,5]),
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37658?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: I13e80e9dbddbb145411378a0d9e01461aef75db4
Gerrit-Change-Number: 37658
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/37680?usp=email )
Change subject: pySim.tlv: Fix from_dict of nested TLVs
......................................................................
pySim.tlv: Fix from_dict of nested TLVs
The existing logic is wrong. How we call from_dict() doesn't differ if
a member IE itself contains a nested collection: We always must pass a
single-entry dict with the snak-case name of the class to from_dict().
Change-Id: Ic1f9db45db75b887227c2e20785198814cbab0f5
Fixes: OS#6453
---
M pySim/tlv.py
1 file changed, 15 insertions(+), 6 deletions(-)
Approvals:
fixeria: Looks good to me, but someone else must approve; Verified
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 8180fd1..bd3c901 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -495,12 +495,7 @@
# resolve the class for that name; create an instance of it
cls = self.members_by_name[k]
inst = cls()
- if cls.nested_collection_cls:
- # in case of collections, we want to pass the raw "value" portion to from_dict,
- # as to_dict() below intentionally omits the collection-class-name as key
- inst.from_dict(i[k])
- else:
- inst.from_dict({k: i[k]})
+ inst.from_dict({k: i[k]})
res.append(inst)
else:
raise ValueError('%s: Unknown TLV Class %s in %s; expected %s' %
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37680?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: Ic1f9db45db75b887227c2e20785198814cbab0f5
Gerrit-Change-Number: 37680
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: merged
laforge has submitted this change. ( 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(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
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-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( 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(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
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-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged