Attention is currently required from: laforge, lynxis lazus, osmith.
Hello Jenkins Builder, lynxis lazus, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/36960?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Code-Review+1 by lynxis lazus, Code-Review+1 by osmith, Verified+1 by Jenkins Builder
Change subject: esim.saip: Implement ProfileElement.header_name for more PE types
......................................................................
esim.saip: Implement ProfileElement.header_name for more PE types
We now cover all PE types as of PE_Definitions-3.3.1.asn
Change-Id: I37951a0441fe53fce7a329066aebd973389cb743
---
M pySim/esim/saip/__init__.py
1 file changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/36960/4
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36960?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: I37951a0441fe53fce7a329066aebd973389cb743
Gerrit-Change-Number: 36960
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter.
Hello Jenkins Builder, dexter,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/36974?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: add contrib/es9p_client: Perform ES9+ client functions like LPA+eUICC
......................................................................
add contrib/es9p_client: Perform ES9+ client functions like LPA+eUICC
This tool can be used to test the SM-DP+. It implements the full dance
of all HTTPs API operations to get to the downloadProfile, and will
decrypt the BPP to the UPP, which is then subsequently stored as file on
disk.
Needless to say, this will only work if you have an eUICC certificate +
private key that is compatible with the CI of your SM-DP+.
Change-Id: Idf8881e82f9835f5221c58b78ced9937cf5fb520
---
A contrib/es9p_client.py
M pySim/esim/es8p.py
2 files changed, 339 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/74/36974/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36974?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: Idf8881e82f9835f5221c58b78ced9937cf5fb520
Gerrit-Change-Number: 36974
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: dexter.
Hello Jenkins Builder, dexter, fixeria, osmith,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/36931?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: global_platform/euicc: Implement obtaining SCP keys from CardKeyProvider
......................................................................
global_platform/euicc: Implement obtaining SCP keys from CardKeyProvider
Now that CardKeyProvider is capable of storing key materials
transport-key-encrypted, we can use this functionality to look up the
SCP02 / SCP03 key material for a given security domain.
This patch implements this for the ISD-R and ECASD using a look-up by
EID inside the CSV.
Change-Id: I2a21f031ab8af88019af1b8390612678b9b35880
---
M pySim/euicc.py
M pySim/global_platform/__init__.py
2 files changed, 53 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/31/36931/6
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36931?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: I2a21f031ab8af88019af1b8390612678b9b35880
Gerrit-Change-Number: 36931
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newpatchset
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36959?usp=email )
Change subject: pySim.esim.saip.validation: Ensure unique PE identification value
......................................................................
pySim.esim.saip.validation: Ensure unique PE identification value
Change-Id: I37b9eb4cfb74de79b0493986d976c8a5f8ccd8ea
---
M pySim/esim/saip/validation.py
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/esim/saip/validation.py b/pySim/esim/saip/validation.py
index f9f5773..c253b7a 100644
--- a/pySim/esim/saip/validation.py
+++ b/pySim/esim/saip/validation.py
@@ -95,6 +95,12 @@
if 'profile-a-p256' in m_svcs and not ('usim' in m_svcs or 'isim' in m_svcs):
raise ProfileError('profile-a-p256 mandatory, but no usim or isim')
+ def check_identification_unique(self, pes: ProfileElementSequence):
+ """Ensure that each PE has a unique identification value."""
+ id_list = [pe.header['identification'] for pe in pes.pe_list if pe.header]
+ if len(id_list) != len(set(id_list)):
+ raise ProfileError('PE identification values are not unique')
+
FileChoiceList = List[Tuple]
class FileError(ProfileError):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36959?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: I37b9eb4cfb74de79b0493986d976c8a5f8ccd8ea
Gerrit-Change-Number: 36959
Gerrit-PatchSet: 4
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36957?usp=email )
Change subject: esim.saip: Introduce ProfileElement derived classes
......................................................................
esim.saip: Introduce ProfileElement derived classes
It's rather useful to have derived classes implementing specific
functions related to that SAIP profile type. Let's introruce that
concept and a first example for securityDomain, where methods allow
checking/adding/removing support for SCPs.
Change-Id: I0929cc704b2aabddbc2ddee79ab8b674b1ed4691
---
M pySim/esim/saip/__init__.py
1 file changed, 62 insertions(+), 8 deletions(-)
Approvals:
osmith: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index b8e41ce..fc86b63 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -26,6 +26,8 @@
from pySim.construct import build_construct
from pySim.esim import compile_asn1_subdir
from pySim.esim.saip import templates
+from pySim.tlv import BER_TLV_IE
+from pySim.global_platform.uicc import UiccSdInstallParams
asn1 = compile_asn1_subdir('saip')
@@ -134,6 +136,9 @@
"""Class representing a Profile Element (PE) within a SAIP Profile."""
FILE_BEARING = ['mf', 'cd', 'telecom', 'usim', 'opt-usim', 'isim', 'opt-isim', 'phonebook', 'gsm-access',
'csim', 'opt-csim', 'eap', 'df-5gs', 'df-saip', 'df-snpn', 'df-5gprose', 'iot', 'opt-iot']
+ def __init__(self, decoded = None):
+ self.decoded = decoded
+
def _fixup_sqnInit_dec(self) -> None:
"""asn1tools has a bug when working with SEQUENCE OF that have DEFAULT values. Let's work around
this."""
@@ -161,12 +166,6 @@
# none of the fields were initialized with a non-default (non-zero) value, so we can skip it
del self.decoded['sqnInit']
- def parse_der(self, der: bytes) -> None:
- """Parse a sequence of PE and store the result in instance attributes."""
- self.type, self.decoded = asn1.decode('ProfileElement', der)
- # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
- self._fixup_sqnInit_dec()
-
@property
def header_name(self) -> str:
"""Return the name of the header field within the profile element."""
@@ -195,12 +194,24 @@
@classmethod
def from_der(cls, der: bytes) -> 'ProfileElement':
"""Construct an instance from given raw, DER encoded bytes."""
- inst = cls()
- inst.parse_der(der)
+ pe_type, decoded = asn1.decode('ProfileElement', der)
+ if pe_type == 'securityDomain':
+ inst = ProfileElementSD(decoded)
+ else:
+ inst = ProfileElement(decoded)
+ inst.type = pe_type
+ # work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
+ inst._fixup_sqnInit_dec()
+ # run any post-decoder a derived class may have
+ if hasattr(inst, '_post_decode'):
+ inst._post_decode()
return inst
def to_der(self) -> bytes:
"""Build an encoded DER representation of the instance."""
+ # run any pre-encoder a derived class may have
+ if hasattr(self, '_pre_encode'):
+ self._pre_encode()
# work around asn1tools bug regarding DEFAULT for a SEQUENCE OF
self._fixup_sqnInit_enc()
return asn1.encode('ProfileElement', (self.type, self.decoded))
@@ -208,6 +219,35 @@
def __str__(self) -> str:
return self.type
+class ProfileElementSD(ProfileElement):
+ """Class representing a securityDomain ProfileElement."""
+ type = 'securityDomain'
+
+ class C9(BER_TLV_IE, tag=0xC9, nested=UiccSdInstallParams):
+ pass
+
+ def _post_decode(self):
+ self.usip = self.C9()
+ self.usip.from_bytes(self.decoded['instance']['applicationSpecificParametersC9'])
+
+ def _pre_encode(self):
+ self.decoded['instance']['applicationSpecificParametersC9'] = self.usip.to_bytes()
+
+ def has_scp(self, scp: int) -> bool:
+ """Determine if SD Installation parameters already specify given SCP."""
+ return self.usip.nested_collection.has_scp(scp)
+
+ def add_scp(self, scp: int, i: int):
+ """Add given SCP (and i parameter) to list of SCP of the Security Domain Install Params.
+ Example: add_scp(0x03, 0x70) for SCP03, or add_scp(0x02, 0x55) for SCP02."""
+ self.usip.nested_collection.add_scp(scp, i)
+ self._pre_encode()
+
+ def remove_scp(self, scp: int):
+ """Remove given SCP from list of SCP of the Security Domain Install Params."""
+ self.usip.nested_collection.remove_scp(scp)
+ self._pre_encode()
+
def bertlv_first_segment(binary: bytes) -> Tuple[bytes, bytes]:
"""obtain the first segment of a binary concatenation of BER-TLV objects.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36957?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: I0929cc704b2aabddbc2ddee79ab8b674b1ed4691
Gerrit-Change-Number: 36957
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: merged