neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/43290?usp=email )
Change subject: ts_31_102.py: EF_SUCI_Calc_Info(TransparentEF): fix len test
......................................................................
ts_31_102.py: EF_SUCI_Calc_Info(TransparentEF): fix len test
while len(foo):
throws an exception when foo == None.
Instead doing
while foo:
fixes a problem when reading in empty SUCI calc info data, e.g. from
TS48v7.0_SAIP2.3_BERTLV_SUCI_NoRAMRFM.der.
Change-Id: Ia4e2356d0241d7a6ca399ba7e8be7f27ec836104
Jenkins: skip-card-test
---
M pySim/ts_31_102.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/90/43290/1
diff --git a/pySim/ts_31_102.py b/pySim/ts_31_102.py
index b354b32..843f7c4 100644
--- a/pySim/ts_31_102.py
+++ b/pySim/ts_31_102.py
@@ -335,7 +335,7 @@
"""conversion method to generate list of {hnet_pubkey_identifier, hnet_pubkey} dicts
from flat [{hnet_pubkey_identifier: }, {net_pubkey: }, ...] list"""
out = []
- while len(l):
+ while l:
a = l.pop(0)
b = l.pop(0)
z = {**a, **b}
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43290?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: Ia4e2356d0241d7a6ca399ba7e8be7f27ec836104
Gerrit-Change-Number: 43290
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/43289?usp=email )
Change subject: typo 'concetenation' in personalization.py
......................................................................
typo 'concetenation' in personalization.py
Change-Id: I51345db014335e8a70a7437a9cad5a3e47570a95
Jenkins: skip-card-test
---
M pySim/esim/saip/personalization.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/89/43289/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index a73678f..6f88d52 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -1156,7 +1156,7 @@
class MilenageXoringConstants(BinaryParam, AlgoConfig):
"""XOR-ing constants c1,c2,c3,c4,c5 of Milenage, 128bit each. See 3GPP TS 35.206 Sections 2.3 + 5.3.
- Provided as octet-string concatenation of all 5 constants. The default value by 3GPP is the concetenation
+ Provided as octet-string concatenation of all 5 constants. The default value by 3GPP is the concatenation
of::
00000000000000000000000000000000
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43289?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: I51345db014335e8a70a7437a9cad5a3e47570a95
Gerrit-Change-Number: 43289
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/43287?usp=email )
Change subject: saip BatchPersonalization: call rebuild_mandatory_services()
......................................................................
saip BatchPersonalization: call rebuild_mandatory_services()
Particular reason: when manipulating the 5G SUCI parameters, the
mandatory services get-identity, profile-a-x25519 and profile-b-p256 may
need to be reconfigured.
In general, it is a good idea to run these checks anyway.
Change-Id: I5e6eef0f1845a25cddb03af8d16c40e305bcdc1f
Jenkins: skip-card-test
---
M pySim/esim/saip/batch.py
1 file changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/87/43287/1
diff --git a/pySim/esim/saip/batch.py b/pySim/esim/saip/batch.py
index 6d3ded1..338c5d1 100644
--- a/pySim/esim/saip/batch.py
+++ b/pySim/esim/saip/batch.py
@@ -123,6 +123,8 @@
except Exception as e:
raise ValueError(f'{p.param_cls.get_name()} fed by {p.src.name}: {e}') from e
+ pes.rebuild_mandatory_services()
+
yield pes
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/43287?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: I5e6eef0f1845a25cddb03af8d16c40e305bcdc1f
Gerrit-Change-Number: 43287
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
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>