laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/36016?usp=email )
Change subject: personalization: differentiate input_value from value
......................................................................
personalization: differentiate input_value from value
When personalizing e.g. the ICCID, the input_value is the raw
incrementing counter. From that, we calculate the Luhn check digit,
and that "output" value is what we'll put in to the EF.ICCID specific
encoder.
However, we also store that output value in the instance in order
to generate the output CSV file containig the card-specific
personalization data.
Change-Id: Idfcd26c8ca9d73a9c2955f7c97e711dd59a27c4e
---
M pySim/esim/saip/personalization.py
1 file changed, 50 insertions(+), 20 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/16/36016/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index 8ea1d80..6828ea8 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -46,13 +46,15 @@
class ConfigurableParameter(abc.ABC, metaclass=ClassVarMeta):
"""Base class representing a part of the eSIM profile that is configurable during the
personalization process (with dynamic data from elsewhere)."""
- def __init__(self, value):
- self.value = value
+ def __init__(self, input_value):
+ self.input_value = input_value # the raw input value as given by caller
+ self.value = None # the processed input value (e.g. with check digit) as produced by validate()
def validate(self):
"""Optional validation method. Can be used by derived classes to perform validation
of the input value (self.value). Will raise an exception if validation fails."""
- pass
+ # default implementation: simply copy input_value over to value
+ self.value = self.input_value
@abc.abstractmethod
def apply(self, pes: ProfileElementSequence):
@@ -65,18 +67,18 @@
def validate(self):
# convert to string as it migt be an integer
- iccid_str = str(self.value)
+ iccid_str = str(self.input_value)
if len(iccid_str) < 18 or len(iccid_str) > 20:
raise ValueError('ICCID must be 18, 19 or 20 digits long')
if not iccid_str.isdecimal():
raise ValueError('ICCID must only contain decimal digits')
+ self.value = sanitize_iccid(iccid_str)
def apply(self, pes: ProfileElementSequence):
- iccid_str = sanitize_iccid(self.value)
# patch the header
- pes.get_pe_for_type('header').decoded['iccid'] = iccid_str
+ pes.get_pe_for_type('header').decoded['iccid'] = self.value
# patch MF/EF.ICCID
- file_replace_content(pes.get_pe_for_type('mf').decoded['ef-iccid'], h2b(enc_iccid(iccid_str)))
+ file_replace_content(pes.get_pe_for_type('mf').decoded['ef-iccid'], h2b(enc_iccid(self.value)))
class Imsi(ConfigurableParameter):
"""Configurable IMSI. Expects value to be a string of digits. Automatically sets the ACC to
@@ -85,14 +87,15 @@
def validate(self):
# convert to string as it migt be an integer
- imsi_str = str(self.value)
+ imsi_str = str(self.input_value)
if len(imsi_str) < 6 or len(imsi_str) > 15:
raise ValueError('IMSI must be 6..15 digits long')
if not imsi_str.isdecimal():
raise ValueError('IMSI must only contain decimal digits')
+ self.value = imsi_str
def apply(self, pes: ProfileElementSequence):
- imsi_str = str(self.value)
+ imsi_str = self.value
# we always use the least significant byte of the IMSI as ACC
acc = (1 << int(imsi_str[-1]))
# patch ADF.USIM/EF.IMSI
@@ -111,11 +114,12 @@
permitted_len = None
def validate(self):
- if not isinstance(self.value, (io.BytesIO, bytes, bytearray)):
+ if not isinstance(self.input_value, (io.BytesIO, bytes, bytearray)):
raise ValueError('Value must be of bytes-like type')
if self.permitted_len:
- if len(self.value) not in self.permitted_len:
+ if len(self.input_value) not in self.permitted_len:
raise ValueError('Value length must be %s' % self.permitted_len)
+ self.value = self.input_value
def _apply_sd(self, pe: ProfileElement):
assert pe.type == 'securityDomain'
@@ -207,8 +211,10 @@
"""Configurable PUK (Pin Unblock Code). String ASCII-encoded digits."""
keyReference = None
def validate(self):
- if isinstance(self.value, int):
- self.value = '%08d' % self.value
+ if isinstance(self.input_value, int):
+ self.value = '%08d' % self.input_value
+ else:
+ self.value = self.input_value
# FIXME: valid length?
if not self.value.isdecimal():
raise ValueError('PUK must only contain decimal digits')
@@ -232,8 +238,10 @@
"""Configurable PIN (Personal Identification Number). String of digits."""
keyReference = None
def validate(self):
- if isinstance(self.value, int):
- self.value = '%04d' % self.value
+ if isinstance(self.input_value, int):
+ self.value = '%04d' % self.input_value
+ else:
+ self.value = self.input_value
if len(self.value) < 4 or len(self.value) > 8:
raise ValueError('PIN mus be 4..8 digits long')
if not self.value.isdecimal():
@@ -254,8 +262,10 @@
"""Configurable PIN (Personal Identification Number). String of digits."""
keyReference = None
def validate(self):
- if isinstance(self.value, int):
- self.value = '%04d' % self.value
+ if isinstance(self.input_value, int):
+ self.value = '%04d' % self.input_value
+ else:
+ self.value = self.input_value
if len(self.value) < 4 or len(self.value) > 8:
raise ValueError('PIN mus be 4..8 digits long')
if not self.value.isdecimal():
@@ -292,8 +302,9 @@
"""Configurable Algorithm parameter. bytes."""
key = None
def validate(self):
- if not isinstance(self.value, (io.BytesIO, bytes, bytearray)):
+ if not isinstance(self.input_value, (io.BytesIO, bytes, bytearray)):
raise ValueError('Value must be of bytes-like type')
+ self.value = self.input_value
def apply(self, pes: ProfileElementSequence):
for pe in pes.get_pes_for_type('akaParameter'):
algoConfiguration = pe.decoded['algoConfiguration']
@@ -307,5 +318,6 @@
pass
class AlgorithmID(AlgoConfig, key='algorithmID'):
def validate(self):
- if self.value not in [1, 2, 3]:
- raise ValueError('Invalid algorithmID %s' % (self.value))
+ if self.input_value not in [1, 2, 3]:
+ raise ValueError('Invalid algorithmID %s' % (self.input_value))
+ self.value = self.input_value
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36016?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: Idfcd26c8ca9d73a9c2955f7c97e711dd59a27c4e
Gerrit-Change-Number: 36016
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
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/+/36009?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: utils: Add function to verify Luhn check digits and to sanitize ICCIDs
......................................................................
utils: Add function to verify Luhn check digits and to sanitize ICCIDs
Change-Id: I7812420cf97984dd834fca6a38c5e5ae113243cb
---
M pySim/utils.py
M tests/test_utils.py
2 files changed, 56 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/09/36009/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36009?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: I7812420cf97984dd834fca6a38c5e5ae113243cb
Gerrit-Change-Number: 36009
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/36010?usp=email
to look at the new patch set (#2).
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: asn1/saip: Fix typo in original ASN.1: Compontents -> Components
......................................................................
asn1/saip: Fix typo in original ASN.1: Compontents -> Components
Change-Id: I6bec5625579873a9ec267d896584608c9d5e3a2f
---
M pySim/esim/asn1/saip/PE_Definitions-3.3.1.asn
1 file changed, 10 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/10/36010/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36010?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: I6bec5625579873a9ec267d896584608c9d5e3a2f
Gerrit-Change-Number: 36010
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
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/+/36015?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: saip.personalization: Add support for SCP80/81/02/03 keys
......................................................................
saip.personalization: Add support for SCP80/81/02/03 keys
Those keys are normally per-card unique, and hence the personalization
must be able to modify them in the profile.
Change-Id: Ibe4806366f1cce8edb09d52613b1dd56250fa5ae
---
M pySim/esim/saip/personalization.py
1 file changed, 105 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/15/36015/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36015?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: Ibe4806366f1cce8edb09d52613b1dd56250fa5ae
Gerrit-Change-Number: 36015
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
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/+/36014?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: saip.personalization: include encode/decode of value; add validation method
......................................................................
saip.personalization: include encode/decode of value; add validation method
Change-Id: Ia9fa39c25817448afb191061acd4be894300eeef
---
M pySim/esim/saip/personalization.py
1 file changed, 84 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/14/36014/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36014?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: Ia9fa39c25817448afb191061acd4be894300eeef
Gerrit-Change-Number: 36014
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/35796?usp=email )
Change subject: Implement M3UA-over-TCP (in addition to SCTP)
......................................................................
Patch Set 6:
(1 comment)
File TODO-RELEASE:
https://gerrit.osmocom.org/c/libosmo-sccp/+/35796/comment/ff6769b1_b64905cf
PS6, Line 15: libosmo-sigtran ABI change struct osmo_ss7_asp: new field(s)
> new field(s) at the end.
We always add new fields at the end, so I don't see the need to clarify this here.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/35796?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I8c76d271472befacbeb998a93bbdc9e8660d9b5d
Gerrit-Change-Number: 35796
Gerrit-PatchSet: 6
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-CC: jolly <andreas(a)eversberg.eu>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 18 Feb 2024 21:07:18 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/35998?usp=email )
Change subject: examples/sccp_demo_user: fix default ASP protocol in help
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/35998?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I8481fd8707ed7985071c5c64ee621d210fb4d493
Gerrit-Change-Number: 35998
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 18 Feb 2024 20:25:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36008?usp=email )
Change subject: xua_asp_send_xlm_prim(): use LOGPFSML() to print more context
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36008?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I28f3f89a8158bbedc224922a6ec151b1bbd6c7c0
Gerrit-Change-Number: 36008
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 18 Feb 2024 20:21:50 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36007?usp=email )
Change subject: cosmetic: xua_cli_connect_cb(): fix typo in a comment
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/36007?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I8fb57dc60c34ed3db2ea5394c3c452604217de91
Gerrit-Change-Number: 36007
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 18 Feb 2024 20:19:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment