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

November 2026

  • 1 participants
  • 714 discussions
[S] Change in pysim[master]: esim.bsp: keep encrypted segments within 1020 bytes
by hampushellsberg 20 Nov '26

20 Nov '26
hampushellsberg has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/44153?usp=email ) Change subject: esim.bsp: keep encrypted segments within 1020 bytes ...................................................................... esim.bsp: keep encrypted segments within 1020 bytes SGP.22 limits a segment to 1020 bytes including tag, length field and MAC, which leaves 1008 bytes for the ciphertext. encrypt_and_mac() cut the plaintext at 1008 bytes; the mandatory '80' padding then added a whole block and the segment got 1036 bytes long. An eUICC that enforces the limit can refuse the first such segment of a profile. Cut encrypted plaintext at 1007 bytes; MAC-only segments keep 1008. The folder osmocom-pysim-bsp-segment-size of hampushellsberg-dev/PySIM-upstream-patches on GitHub has the analysis and a repro. Change-Id: Ie59a8fb3d6cefc079e4e065d8ab9bd9cec886513 --- M pySim/esim/bsp.py M tests/unittests/test_esim_bsp.py 2 files changed, 37 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/53/44153/1 diff --git a/pySim/esim/bsp.py b/pySim/esim/bsp.py index cd4114f..b08e94c 100644 --- a/pySim/esim/bsp.py +++ b/pySim/esim/bsp.py @@ -235,6 +235,9 @@ TAG_LEN = 1 length_len = len(bertlv_encode_len(MAX_SEGMENT_SIZE)) self.max_payload_size = MAX_SEGMENT_SIZE - TAG_LEN - length_len - self.m_algo.l_mac + # SGP.22 v3.1 2.5.3 NOTE: the '80' padding takes at least one byte of the ciphertext + blocksize = self.c_algo.blocksize + self.max_encrypted_payload_size = self.max_payload_size // blocksize * blocksize - 1 @classmethod def from_kdf(cls, shared_secret: bytes, key_type: int, key_length: int, host_id: bytes, eid: bytes): @@ -245,7 +248,7 @@ def encrypt_and_mac_one(self, tag: int, plaintext:bytes) -> bytes: """Encrypt + MAC a single plaintext TLV. Returns the protected ciphertext.""" assert tag <= 255 - assert len(plaintext) <= self.max_payload_size + assert len(plaintext) <= self.max_encrypted_payload_size # DEBUG: Show what we're processing logger.debug(f"BSP_DEBUG: encrypt_and_mac_one(tag=0x{tag:02x}, plaintext_len={len(plaintext)})") @@ -268,12 +271,12 @@ result = [] while len(remainder): remaining_len = len(remainder) - if remaining_len < self.max_payload_size: + if remaining_len < self.max_encrypted_payload_size: segment_len = remaining_len segment = remainder remainder = b'' else: - segment_len = self.max_payload_size + segment_len = self.max_encrypted_payload_size segment = remainder[0:segment_len] remainder = remainder[segment_len:] result.append(self.encrypt_and_mac_one(tag, segment)) diff --git a/tests/unittests/test_esim_bsp.py b/tests/unittests/test_esim_bsp.py index e8e8131..4580630 100755 --- a/tests/unittests/test_esim_bsp.py +++ b/tests/unittests/test_esim_bsp.py @@ -94,5 +94,36 @@ self.assertEqual(plain_upp, base64.b64decode(original_upp)) +class TestBSPsegmentSize(unittest.TestCase): + """SGP.22 v3.1 2.5.3: a segment has at most 1020 bytes, including tag, length field and MAC.""" + + @staticmethod + def _pair(): + keys = (h2b('00112233445566778899aabbccddeeff'), h2b('ffeeddccbbaa99887766554433221100'), bytes(16)) + return BspInstance(*keys), BspInstance(*keys) + + def test_encrypted_segments(self): + for length in (1, 1006, 1007, 1008, 1009, 2014, 2015, 5000): + tx, rx = self._pair() + plaintext = bytes(i % 251 for i in range(length)) + segments = tx.encrypt_and_mac(0x86, plaintext) + self.assertEqual(len(segments), -(-length // 1007)) + for segment in segments: + self.assertLessEqual(len(segment), MAX_SEGMENT_SIZE) + self.assertEqual(rx.demac_and_decrypt(segments), plaintext) + + def test_full_encrypted_segment(self): + tx, _ = self._pair() + self.assertEqual(tx.max_encrypted_payload_size, 1007) + self.assertEqual(len(tx.encrypt_and_mac_one(0x86, bytes(1007))), MAX_SEGMENT_SIZE) + + def test_mac_only_segments(self): + tx, rx = self._pair() + plaintext = bytes(i % 251 for i in range(2500)) + segments = tx.mac_only(0x88, plaintext) + self.assertEqual([len(x) for x in segments], [MAX_SEGMENT_SIZE, MAX_SEGMENT_SIZE, 496]) + self.assertEqual(rx.demac_only(segments), plaintext) + + if __name__ == "__main__": unittest.main() -- To view, visit https://gerrit.osmocom.org/c/pysim/+/44153?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ie59a8fb3d6cefc079e4e065d8ab9bd9cec886513 Gerrit-Change-Number: 44153 Gerrit-PatchSet: 1 Gerrit-Owner: hampushellsberg <hampushellsberg(a)gmail.com>
1 0
0 0
[XL] Change in pysim[master]: esim/asn1: add the SGP.22 v3.1 RSPDefinitions module as rsp_v3
by hampushellsberg 20 Nov '26

20 Nov '26
Attention is currently required from: laforge. hampushellsberg has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/pysim/+/44007?usp=email ) Change subject: esim/asn1: add the SGP.22 v3.1 RSPDefinitions module as rsp_v3 ...................................................................... esim/asn1: add the SGP.22 v3.1 RSPDefinitions module as rsp_v3 pySim only has the SGP.22 v2 module, so none of the types v3.1 added (EuiccConfiguredData, LoadRpmPackage, ...) can be encoded or decoded. rsp.asn cannot simply be updated: v3.1 renames and drops members that existing callers use, and SGP.32 imports v2 types that v3.1 removed. Add the Annex H module as asn1/rsp_v3, available as rsp.asn1_v3, and compile_asn1_paths() to compile it together with the SAIP and PKIX modules it imports. A module __getattr__ (PEP 562) compiles it on the first access of rsp.asn1_v3, so importing pySim.esim.rsp costs no more than before. The folder osmocom-pysim-rsp-v3-module of hampushellsberg-dev/PySIM-upstream-patches on GitHub has the analysis, the transcription script and a repro. Change-Id: I670ec73f9958882a8d3fe4b589bdafa3fbf702ea --- M pySim/esim/__init__.py A pySim/esim/asn1/rsp_v3/rsp.asn M pySim/esim/rsp.py M setup.py A tests/unittests/test_esim_rsp.py 5 files changed, 1,789 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/07/44007/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/44007?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I670ec73f9958882a8d3fe4b589bdafa3fbf702ea Gerrit-Change-Number: 44007 Gerrit-PatchSet: 2 Gerrit-Owner: hampushellsberg <hampushellsberg(a)gmail.com> Gerrit-CC: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: esim/asn1/rsp: add the two types the SGP.32 module imports
by hampushellsberg 20 Nov '26

20 Nov '26
Attention is currently required from: laforge. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/44008?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: esim/asn1/rsp: add the two types the SGP.32 module imports ...................................................................... esim/asn1/rsp: add the two types the SGP.32 module imports The SGP.32 v1.3 ASN.1 module imports OperatorId and VendorSpecificExtension from RSPDefinitions (sgp22v2). The v2 module spells the first OperatorID and lacks the second, which SGP.22 v3.1 marks as supported from v2.4.0, so compiling the SGP.32 module against it fails. Add OperatorId as an alias, and VendorSpecificExtension as Annex H of SGP.22 v3.1 defines it, with OBJECT IDENTIFIER and ANY for its two OPENTYPE members. The folder osmocom-pysim-rsp-operatorid of hampushellsberg-dev/PySIM-upstream-patches on GitHub has the analysis and a repro. Change-Id: I23d8c7e061a5573caa750fe76a6e8756ddbf0898 --- M pySim/esim/asn1/rsp/rsp.asn M tests/unittests/test_esim_rsp.py 2 files changed, 45 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/08/44008/2 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/44008?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I23d8c7e061a5573caa750fe76a6e8756ddbf0898 Gerrit-Change-Number: 44008 Gerrit-PatchSet: 2 Gerrit-Owner: hampushellsberg <hampushellsberg(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org>
1 0
0 0
[S] Change in pysim[master]: esim/asn1/rsp: add OperatorId as an alias of OperatorID
by hampushellsberg 20 Nov '26

20 Nov '26
Attention is currently required from: laforge. hampushellsberg has posted comments on this change by hampushellsberg. ( https://gerrit.osmocom.org/c/pysim/+/44008?usp=email ) Change subject: esim/asn1/rsp: add OperatorId as an alias of OperatorID ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: > retriggered Patch set 2 is rebased onto 44007 patch set 2 and also adds VendorSpecificExtension, the other name the SGP.32 v1.3 module imports from RSPDefinitions. It used to come in with 43977; with 43977 abandoned, the OperatorId alias alone no longer lets the SGP.32 module compile against rsp.asn. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/44008?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I23d8c7e061a5573caa750fe76a6e8756ddbf0898 Gerrit-Change-Number: 44008 Gerrit-PatchSet: 1 Gerrit-Owner: hampushellsberg <hampushellsberg(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 20 Nov 2026 08:37:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: hampushellsberg <hampushellsberg(a)gmail.com>
1 0
0 0
[XL] Change in pysim[master]: esim/asn1: add the SGP.22 v3.1 RSPDefinitions module as rsp_v3
by hampushellsberg 20 Nov '26

20 Nov '26
Attention is currently required from: laforge. hampushellsberg has posted comments on this change by hampushellsberg. ( https://gerrit.osmocom.org/c/pysim/+/44007?usp=email ) Change subject: esim/asn1: add the SGP.22 v3.1 RSPDefinitions module as rsp_v3 ...................................................................... Patch Set 1: (1 comment) File pySim/esim/rsp.py: https://gerrit.osmocom.org/c/pysim/+/44007/comment/a2919ce9_ea7370da?usp=em… : PS1, Line 35: asn1_v3 > Ideally i would have something that looks like a variable at module level (or an instance variable, […] There is: since Python 3.7 a module can define `__getattr__` (PEP 562), which Python only calls for names the module does not have. Done in patch set 2: `rsp.asn1_v3` now reads like `rsp.asn1`, the first access compiles the module and stores it as a global, so later accesses are a plain attribute lookup and importing pySim.esim.rsp costs the same as before. Patch set 2 also sits directly on master now that 44006 is abandoned, so the test file is created here. -- To view, visit https://gerrit.osmocom.org/c/pysim/+/44007?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I670ec73f9958882a8d3fe4b589bdafa3fbf702ea Gerrit-Change-Number: 44007 Gerrit-PatchSet: 1 Gerrit-Owner: hampushellsberg <hampushellsberg(a)gmail.com> Gerrit-CC: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Fri, 20 Nov 2026 08:36:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: hampushellsberg <hampushellsberg(a)gmail.com>
1 0
0 0
[L] Change in osmo-ttcn3-hacks[master]: Introduce nrf testsuite
by osmith 20 Nov '26

20 Nov '26
Attention is currently required from: fixeria, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44152?usp=email ) Change subject: Introduce nrf testsuite ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44152?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ibe60a996685c6c08443ad9209c33b5961aef4b1f Gerrit-Change-Number: 44152 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Fri, 20 Nov 2026 08:01:19 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: nssf: Remove unneeded file open5gs-eir.yaml
by osmith 20 Nov '26

20 Nov '26
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44151?usp=email ) Change subject: nssf: Remove unneeded file open5gs-eir.yaml ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/44151?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic4bb24c2791be8cc0821c2366ebf9aee433f9c6b Gerrit-Change-Number: 44151 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Fri, 20 Nov 2026 07:57:26 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[S] Change in osmo-sgsn[master]: sgsn_libgtp: encode IMEISV via a local LV buffer
by bucketking657 19 Nov '26

19 Nov '26
Attention is currently required from: pespin. bucketking657 has posted comments on this change by bucketking657. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email ) Change subject: sgsn_libgtp: encode IMEISV via a local LV buffer ...................................................................... Patch Set 3: (1 comment) File src/sgsn/sgsn_libgtp.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/44150/comment/2da08f67_f8b9b030?us… : PS1, Line 306: gsm48_encode_bcd_number(&pdp->imeisv.v[0], 9, 0, mmctx->imei); > This is all imho a bit clunky, since we are encoding LV into a buffer which expects to only have V, […] ok, no problem. Reworked as suggested in PS2 I added a log message when encoding fails, follows same log pattern as other encoding failures within osmo-sgsn in PS3 (e.g. the IMEI encoding in vlr.c). -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ied06aa05ee6850ec0df34a51cdce6df12e0b594c Gerrit-Change-Number: 44150 Gerrit-PatchSet: 3 Gerrit-Owner: bucketking657 <joshuashilts(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 19 Nov 2026 22:56:51 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-sgsn[master]: sgsn_libgtp: encode IMEISV via a local LV buffer
by bucketking657 19 Nov '26

19 Nov '26
Attention is currently required from: bucketking657. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: sgsn_libgtp: encode IMEISV via a local LV buffer ...................................................................... sgsn_libgtp: encode IMEISV via a local LV buffer gsm48_encode_bcd_number() was called on pdp->imeisv.v with max_len 8, which only worked because it compares max_len against the L octet. A 16-digit IMEISV needs 9 bytes (L plus 8 octets). Encode into a local 9-byte LV buffer, check the return code, and copy the value part. Related: OS#7126 Change-Id: Ied06aa05ee6850ec0df34a51cdce6df12e0b594c --- M src/sgsn/sgsn_libgtp.c 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/44150/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ied06aa05ee6850ec0df34a51cdce6df12e0b594c Gerrit-Change-Number: 44150 Gerrit-PatchSet: 3 Gerrit-Owner: bucketking657 <joshuashilts(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: bucketking657 <joshuashilts(a)gmail.com>
1 0
0 0
[S] Change in osmo-sgsn[master]: sgsn_libgtp: encode IMEISV via a local LV buffer
by bucketking657 19 Nov '26

19 Nov '26
Attention is currently required from: bucketking657. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: sgsn_libgtp: encode IMEISV via a local LV buffer ...................................................................... sgsn_libgtp: encode IMEISV via a local LV buffer gsm48_encode_bcd_number() was called on pdp->imeisv.v with max_len 8, which only worked because it compares max_len against the L octet. A 16-digit IMEISV needs 9 bytes (L plus 8 octets). Encode into a local 9-byte LV buffer, check the return code, and copy the value part. Related: OS#7126 Change-Id: Ied06aa05ee6850ec0df34a51cdce6df12e0b594c --- M src/sgsn/sgsn_libgtp.c 1 file changed, 11 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/50/44150/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/44150?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ied06aa05ee6850ec0df34a51cdce6df12e0b594c Gerrit-Change-Number: 44150 Gerrit-PatchSet: 2 Gerrit-Owner: bucketking657 <joshuashilts(a)gmail.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: bucketking657 <joshuashilts(a)gmail.com>
1 0
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • ...
  • 72
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.