neels has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42829?usp=email )
Change subject: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256
......................................................................
saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256
Related: SYS#8096 SYS#8037
Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1
Jenkins: skip-card-test
---
M pySim/esim/saip/__init__.py
1 file changed, 47 insertions(+), 2 deletions(-)
Approvals:
Jenkins Builder: Verified
neels: Looks good to me, approved
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index ec59c50..356800b 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -34,7 +34,7 @@
from pySim.utils import dec_imsi
from pySim.ts_102_221 import FileDescriptor
from pySim.filesystem import CardADF, Path
-from pySim.ts_31_102 import ADF_USIM
+from pySim.ts_31_102 import ADF_USIM, EF_UST, EF_SUCI_Calc_Info
from pySim.ts_31_103 import ADF_ISIM
from pySim.esim import compile_asn1_subdir
from pySim.esim.saip import templates
@@ -1726,7 +1726,52 @@
if 'BT' in ftype_list:
svc_set.add('ber-tlv')
# FIXME:dfLinked files (scan all files, check for non-empty Fcp.linkPath presence of DFs)
- # TODO: 5G related bits (derive from EF.UST or file presence?)
+
+ # 5G:
+ # - When SUCI is:
+ # - enabled (EF.UST 124 = true)
+ # AND
+ # - calculated in the USIM (EF.UST 125 = true),
+ # then eUICC-Mandatory-services needs 'get-identity'.
+ # - 'get-identity' implies that the eUICC must support ONE OF profile-A OR profile-B.
+ # (One might assume from this that, when SUCI-CalcInfo for USIM in DF.SAIP contains both key types, then no
+ # profile-A or B services need to be requested explicitly. However, the correct logic is:)
+ # - Iff the SUCI-CalcInfo for USIM (DF.SAIP) contains a key of profile-A ("identifier": 1),
+ # then eUICC-Mandatory-services needs 'profile-a-x25519'.
+ # - Same: profile-B ("identifier": 2) needs 'profile-b-p256'.
+ # - (When SUCI is calculated in the UE, then the eUICC does not need to provide any of these services.)
+ suci_in_usim_enabled = False
+ try:
+ f_ust = self.get_pe_for_type("usim").files["ef-ust"]
+ ust = EF_UST().decode_bin(f_ust.body)
+ suci_in_usim_enabled = ust[124]['activated'] and ust[125]['activated']
+ except (KeyError, AttributeError):
+ pass
+ if suci_in_usim_enabled:
+ svc_set.add('get-identity')
+ # now check for profile-a and profile-b presence
+ suci_calcinfo_has_profile_a = False
+ suci_calcinfo_has_profile_b = False
+ try:
+ f_sucici = self.get_pe_for_type("df-saip").files["ef-suci-calc-info-usim"]
+ sucici = EF_SUCI_Calc_Info().decode_bin(f_sucici.body) or {}
+ for prot_scheme in sucici['prot_scheme_id_list']:
+ if not isinstance(prot_scheme, dict):
+ continue
+ ps_id = prot_scheme["identifier"]
+ if ps_id == 1:
+ suci_calcinfo_has_profile_a = True
+ elif ps_id == 2:
+ suci_calcinfo_has_profile_b = True
+ except (KeyError, AttributeError):
+ pass
+ if suci_calcinfo_has_profile_a:
+ # The profile has a profile-A key, so require that
+ svc_set.add('profile-a-x25519')
+ if suci_calcinfo_has_profile_b:
+ # The profile has a profile-B key, so require that
+ svc_set.add('profile-b-p256')
+
hdr_pe = self.get_pe_for_type('header')
# patch in the 'manual' services from the existing list:
for old_svc in hdr_pe.decoded['eUICC-Mandatory-services'].keys():
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42829?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1
Gerrit-Change-Number: 42829
Gerrit-PatchSet: 7
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: dexter, lynxis lazus.
Hello Jenkins Builder, dexter, laforge, lynxis lazus,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/42829?usp=email
to look at the new patch set (#6).
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
The change is no longer submittable: Verified is unsatisfied now.
Change subject: saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256
......................................................................
saip.PES.rebuild_mandatory_services(): set 5G get-identity, profile-a-x25519, profile-b-p256
Related: SYS#8096 SYS#8037
Change-Id: Ibc29c6437c5c92e2b14938b733156536863465c1
---
M pySim/esim/saip/__init__.py
1 file changed, 47 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/29/42829/6
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42829?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: Ibc29c6437c5c92e2b14938b733156536863465c1
Gerrit-Change-Number: 42829
Gerrit-PatchSet: 6
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: laforge, pespin.
dexter has posted comments on this change by dexter. ( https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email )
Change subject: sgs_iface: clean up code in function decode_mme_name
......................................................................
Patch Set 6:
(1 comment)
File src/libmsc/sgs_iface.c:
https://gerrit.osmocom.org/c/osmo-msc/+/43237/comment/b057d7f7_005a88c9?usp… :
PS6, Line 192: osmo_apn_to_str(mme_name, mme_name_enc, mme_name_enc_len);
> if we end up here, does it makes sense to previously have checked "if (mme_name_enc_len >= mme_name_ […]
The check in line 176 is still valid. The only difference between the two formats is only the delimiter. The gpp format uses a dot as delimiter and the IETF format uses a one byte length field.
But let's take a closer look:
SGS_MME_NAME_LEN = 55
The URL as per 3gpp TS 23.003 looks like this. The URL is 54 bytes long, so I assume we have defined SGS_MME_NAME_LEN to accommodate for the string terminator. (This would also mean that the sgs_iface.c code is a bit unclean now since we add another string terminator byte, but that is a different story).
mmec00.mmegi0000.mme.epc.mncMNC.mccMCC.3gppnetwork.org0
(the string terminator in the TLV object is actually a length byte that is set to 0, see NOTE in 3GPP TS 23.003, section 19.4.2.1)
Now let's hold this against the RFC-1035, section 3.1 format. I have added 'L' to mark the length fields.
Lmmec00Lmmegi0000LmmeLepcLmncMNCLmccMCCL3gppnetwork.org
So both end up with the same length, which mean both will pass the minimum length test and the maximum length test. Apart from the fact that our code now wastes one byte everything should be fine.
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/43237?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I9aec8300f15264b68ac8e7805e93e621b12cafb2
Gerrit-Change-Number: 43237
Gerrit-PatchSet: 6
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Aug 2026 16:09:05 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: laforge, osmith, pespin.
lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/simtrace2/+/43281?usp=email )
Change subject: contrib/jenkins.sh: pin libosmocore to the last release
......................................................................
Patch Set 2:
(1 comment)
Patchset:
PS1:
> What I feat is that this will simply become stuck at that libosmocore version, and then we have an e […]
We also pinned the libosmocore version for osmo-ccid-firmware.
I improved the check and add an env for it.
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43281?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: I753d634674f76c50e1a9cf67e5adc43201d54f0c
Gerrit-Change-Number: 43281
Gerrit-PatchSet: 2
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
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: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 18 Aug 2026 15:39:52 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>