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/+/37421?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: pySim.saip: Add ProfileElementRFM class
......................................................................
pySim.saip: Add ProfileElementRFM class
Change-Id: I547e02c12345932deafa4b914fcaeaa183b69798
---
M pySim/esim/saip/__init__.py
M tests/test_esim_saip.py
2 files changed, 44 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/21/37421/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37421?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: I547e02c12345932deafa4b914fcaeaa183b69798
Gerrit-Change-Number: 37421
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37418?usp=email )
Change subject: tests: Add ProfileElementSD and ProfileElementSSD to test_constructor_encode
......................................................................
tests: Add ProfileElementSD and ProfileElementSSD to test_constructor_encode
Change-Id: Idc6f37b487dfa8a69ac7a50a537cfc317113d501
---
M tests/test_esim_saip.py
1 file changed, 11 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/18/37418/1
diff --git a/tests/test_esim_saip.py b/tests/test_esim_saip.py
index 704f513..4c1b936 100755
--- a/tests/test_esim_saip.py
+++ b/tests/test_esim_saip.py
@@ -66,7 +66,8 @@
def test_constructor_encode(self):
"""Test that DER-encoding of PE created by "empty" constructor works without raising exception."""
for cls in [ProfileElementMF, ProfileElementPuk, ProfileElementPin, ProfileElementTelecom,
- ProfileElementUSIM, ProfileElementISIM, ProfileElementAKA]:
+ ProfileElementUSIM, ProfileElementISIM, ProfileElementAKA, ProfileElementSD,
+ ProfileElementSSD]:
with self.subTest(cls.__name__):
pes = ProfileElementSequence()
inst = cls()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37418?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: Idc6f37b487dfa8a69ac7a50a537cfc317113d501
Gerrit-Change-Number: 37418
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37424?usp=email )
Change subject: pySim.esim.saip: Add methods to rebuild "mandatory" lists in ProfileHeader
......................................................................
pySim.esim.saip: Add methods to rebuild "mandatory" lists in ProfileHeader
The ProfileHeader PE contain lists of template-oids and services that
are mandatory in this profile. Let's add methods that can be used to
(re-) compute those lists based on the actual PE contents of the
sequence.
The idea is that during programmatic construction of a profile, those methods
would be called after appending all PEs, just before encoding the
profile as DER.
Change-Id: Ib43db8695c6eb63965756364fda7546d82df0beb
---
M pySim/esim/saip/__init__.py
1 file changed, 88 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/37424/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index 2fe08ec..9a58f76 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -787,6 +787,76 @@
self.pes_by_naa[cur_naa] = []
self.pes_by_naa[cur_naa].append(cur_naa_list)
+ def rebuild_mandatory_services(self):
+ """(Re-)build the eUICC Mandatory services list of the ProfileHeader based on what's in the
+ PE-Sequence."""
+ # services that we cannot auto-determine and which must hence be manually specified
+ manual_services = ['contactless', 'mbms', 'cat-tp', 'suciCalculatorApi', 'dns-resolution',
+ 'scp11ac', 'scp11c-authorization-mechanism', 's16mode', 'eaka']
+ svc_set = set()
+ # rebuild mandatory NAAs
+ for naa in self.pes_by_naa.keys():
+ if naa not in ['usim', 'isim', 'csim']:
+ continue
+ # see if any of the instances is mandatory
+ for inst in self.pes_by_naa[naa]:
+ if 'mandated' in inst[0].header:
+ svc_set.add(naa)
+ # rebuild algorithms of all mandatory akaParameters
+ for aka in self.get_pes_for_type('akaParameter'):
+ if 'mandated' in aka.header:
+ if aka.decoded['algoConfiguration'][0] == 'algoParameter':
+ algo_par = aka.decoded['algoConfiguration'][1]
+ algo_id = algo_par['algorithmID']
+ if algo_id == 1:
+ svc_set.add('milenage')
+ elif algo_id == 2:
+ if len(algo_par['key']) == 32:
+ svc_set.add('tuak256')
+ else:
+ svc_set.add('tuak128')
+ elif algo_id == 3:
+ svc_set.add('usim-test-algorithm')
+ # rebuild algorithms of all mandatory cdmaParameter
+ for cdma in self.get_pes_for_type('cdmaParameter'):
+ if 'mandated' in cdma.header:
+ svc_set.add('cave')
+ # TODO: gba-{usim,isim} (determine from EF.GBA* ?)
+ # determine if EAP is mandatory
+ for eap in self.get_pes_for_type('eap'):
+ if 'mandated' in eap.header:
+ svc_set.add('eap')
+ # determine if javacard is mandatory
+ for app in self.get_pes_for_type('application'):
+ if 'mandated' in app.header:
+ # javacard / multos distinction is not automatically possible, but multos is hypothetical
+ svc_set.add('javacard')
+ # recompute multiple-{usim,isim,csim}
+ for naa_name in ['usim','isim','csim']:
+ if naa_name in self.pes_by_naa[naa]:
+ if len(self.pes_by_naa[naa]) > 1:
+ svc_set.add('multiple-' + naa_name)
+ # TODO: BER-TLV (scan all files for related type?)
+ # TODO: 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?)
+ 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():
+ if old_svc in manual_services:
+ svc_set.add(old_svc)
+ hdr_pe.decoded['eUICC-Mandatory-services'] = {x: None for x in svc_set}
+
+ def rebuild_mandatory_gfstelist(self):
+ """(Re-)build the eUICC Mandatory GFSTEList of the ProfileHeader based on what's in the
+ PE-Sequence."""
+ template_set = set()
+ for pe in self.pe_list:
+ if pe.header and 'mandated' in pe.header:
+ if 'templateID' in pe.decoded:
+ template_set.add(pe.decoded['templateID'])
+ hdr_pe = self.get_pe_for_type('header')
+ hdr_pe.decoded['eUICC-Mandatory-GFSTEList'] = list(template_set)
+
@classmethod
def from_der(cls, der: bytes) -> 'ProfileElementSequence':
"""Construct an instance from given raw, DER encoded bytes."""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37424?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: Ib43db8695c6eb63965756364fda7546d82df0beb
Gerrit-Change-Number: 37424
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange