Attention is currently required from: dexter, fixeria, laforge, neels.
Hello Jenkins Builder, dexter, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/39742?usp=email
to look at the new patch set (#13).
Change subject: personalization: refactor ConfigurableParameter, Iccid, Imsi
......................................................................
personalization: refactor ConfigurableParameter, Iccid, Imsi
Main points/rationales of the refactoring, details below:
1) common validation implementation
2) offer classmethods
The new features are optional, and will be heavily used by batch
personalization patches coming soon.
Implement Iccid and Imsi to use the new way, with a common abstract
DecimalParam implementation.
So far leave the other parameter classes working as they always did, to
follow suit in subsequent commits.
Details:
1) common validation implementation:
There are very common validation steps in the various parameter
implementations. It is more convenient and much more readable to
implement those once and set simple validation parameters per subclass.
So there now is a validate_val() classmethod, which subclasses can use
as-is to apply the validation parameters -- or subclasses can override
their cls.validate_val() for specialized validation.
(Those subclasses that this patch doesn't touch still override the
self.validate() instance method. Hence they still work as before this
patch, but don't use the new common features yet.)
2) offer stateless classmethods:
It is useful for...
- batch processing of multiple profiles (in upcoming patches) and
- user input validation
to be able to have classmethods that do what self.validate() and
self.apply() do, but do not modify any self.* members.
So far the paradigm was to create a class instance to keep state about
the value. This remains available, but in addition we make available the
paradigm of a singleton that is stateless (the classmethods).
Using self.validate() and self.apply() still work the same as before
this patch, i.e. via self.input_value and self.value -- but in addition,
there are now classmethods that don't touch self.* members.
Related: SYS#6768
Change-Id: I6522be4c463e34897ca9bff2309b3706a88b3ce8
---
M pySim/esim/saip/personalization.py
1 file changed, 202 insertions(+), 36 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/39742/13
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/39742?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: I6522be4c463e34897ca9bff2309b3706a88b3ce8
Gerrit-Change-Number: 39742
Gerrit-PatchSet: 13
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: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/40823?usp=email
to look at the new patch set (#5).
Change subject: add test_configurable_parameters.py
......................................................................
add test_configurable_parameters.py
Change-Id: Ia55f0d11f8197ca15a948a83a34b3488acf1a0b4
---
M pySim/esim/saip/personalization.py
A tests/unittests/smdpp_data
A tests/unittests/test_configurable_parameters.py
A tests/unittests/xo/test_configurable_parameters
4 files changed, 632 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/23/40823/5
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40823?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: Ia55f0d11f8197ca15a948a83a34b3488acf1a0b4
Gerrit-Change-Number: 40823
Gerrit-PatchSet: 5
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/40824?usp=email
to look at the new patch set (#4).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: personalization.ConfigurableParameter: fix BytesIO() input
......................................................................
personalization.ConfigurableParameter: fix BytesIO() input
Change-Id: I0ad160eef9015e76eef10baee7c6b606fe249123
---
M pySim/esim/saip/personalization.py
M tests/unittests/test_configurable_parameters.py
M tests/unittests/xo/test_configurable_parameters
3 files changed, 44 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/40824/4
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40824?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: I0ad160eef9015e76eef10baee7c6b606fe249123
Gerrit-Change-Number: 40824
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/40825?usp=email
to look at the new patch set (#4).
Change subject: personalization: add int as input type for BinaryParameter
......................................................................
personalization: add int as input type for BinaryParameter
Change-Id: I31d8142cb0847a8b291f8dc614d57cb4734f0190
---
M pySim/esim/saip/personalization.py
M tests/unittests/test_configurable_parameters.py
M tests/unittests/xo/test_configurable_parameters
3 files changed, 186 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/25/40825/4
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/40825?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: I31d8142cb0847a8b291f8dc614d57cb4734f0190
Gerrit-Change-Number: 40825
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/pysim/+/41771?usp=email )
Change subject: generate sdkey classes from a list
......................................................................
generate sdkey classes from a list
Change-Id: Ic92ddea6e1fad8167ea75baf78ffc3eb419838c4
---
M pySim/esim/saip/personalization.py
M tests/unittests/test_configurable_parameters.py
M tests/unittests/test_esim_saip.py
M tests/unittests/xo/test_configurable_parameters
4 files changed, 2,238 insertions(+), 62 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/71/41771/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41771?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: Ic92ddea6e1fad8167ea75baf78ffc3eb419838c4
Gerrit-Change-Number: 41771
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Attention is currently required from: neels.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/41772?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: SdKey params: add KVN to SdKey names
......................................................................
SdKey params: add KVN to SdKey names
"SCP80-KVN01" is much more clear than "SCP80-01".
So many things could be 01.
Change-Id: Ie296a438efd4737b39eaf133288ceed51bd593bc
---
M pySim/esim/saip/personalization.py
M tests/unittests/xo/test_configurable_parameters
2 files changed, 497 insertions(+), 497 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/72/41772/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41772?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: Ie296a438efd4737b39eaf133288ceed51bd593bc
Gerrit-Change-Number: 41772
Gerrit-PatchSet: 2
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41769?usp=email )
Change subject: fix typo in doc TuakNumberOfKeccak
......................................................................
fix typo in doc TuakNumberOfKeccak
Change-Id: Ie6f2260d5632dea7409cffd3afa7c8d0b1986a7c
---
M pySim/esim/saip/personalization.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/41769/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index a1df068..3a77990 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -391,7 +391,7 @@
if len(self.input_value) != 80:
raise ValueError('Length of value must be 80 octets')
class TuakNumberOfKeccak(AlgoConfig, key='numberOfKeccak'):
- """Number of iterations of Keccak-f[1600] permuitation as recomended by Section 7.2 of 3GPP TS 35.231.
+ """Number of iterations of Keccak-f[1600] permutation as recomended by Section 7.2 of 3GPP TS 35.231.
The default value by 3GPP is 1."""
def validate(self):
if not isinstance(self.input_value, int):
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41769?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: Ie6f2260d5632dea7409cffd3afa7c8d0b1986a7c
Gerrit-Change-Number: 41769
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41770?usp=email )
Change subject: saip/param_source: try to not repeat random values
......................................................................
saip/param_source: try to not repeat random values
Change-Id: I4fa743ef5677580f94b9df16a5051d1d178edeb0
---
M pySim/esim/saip/param_source.py
1 file changed, 23 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/70/41770/1
diff --git a/pySim/esim/saip/param_source.py b/pySim/esim/saip/param_source.py
index f5d2a35..1e5c92e 100644
--- a/pySim/esim/saip/param_source.py
+++ b/pySim/esim/saip/param_source.py
@@ -100,6 +100,7 @@
'return a different sequence of random decimal digits each'
is_abstract = False
name = 'random decimal digits'
+ used_keys = set()
def __init__(self, num_digits, first_value, last_value):
"""
@@ -118,7 +119,16 @@
self.val_first_last = (first_value, last_value)
def get_next(self, csv_row:dict=None):
- val = self.random_impl.randint(*self.val_first_last)
+ # try to generate random digits that are always different from previously produced random bytes
+ attempts = 10
+ while True:
+ val = self.random_impl.randint(*self.val_first_last)
+ if val in RandomDigitSource.used_keys:
+ attempts -= 1
+ if attempts:
+ continue
+ RandomDigitSource.used_keys.add(val)
+ break
return self.val_to_digit(val)
def val_to_digit(self, val:int):
@@ -144,6 +154,7 @@
'return a different sequence of random hexadecimal digits each'
is_abstract = False
name = 'random hexadecimal digits'
+ used_keys = set()
def __init__(self, num_digits):
'see from_str()'
@@ -156,7 +167,17 @@
self.num_digits = num_digits
def get_next(self, csv_row:dict=None):
- val = self.random_impl.randbytes(self.num_digits // 2)
+ # try to generate random bytes that are always different from previously produced random bytes
+ attempts = 10
+ while True:
+ val = self.random_impl.randbytes(self.num_digits // 2)
+ if val in RandomHexDigitSource.used_keys:
+ attempts -= 1
+ if attempts:
+ continue
+ RandomHexDigitSource.used_keys.add(val)
+ break
+
return b2h(val)
@classmethod
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41770?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: I4fa743ef5677580f94b9df16a5051d1d178edeb0
Gerrit-Change-Number: 41770
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41772?usp=email )
Change subject: SdKey params: add KVN to SdKey names
......................................................................
SdKey params: add KVN to SdKey names
"SCP80-KVN01" is much more clear than "SCP80-01".
So many things could be 01.
Change-Id: Ie296a438efd4737b39eaf133288ceed51bd593bc
---
M pySim/esim/saip/personalization.py
1 file changed, 1 insertion(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/72/41772/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index 085559d..1796e45 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -772,7 +772,7 @@
return
# leaf node. create a new class with all the accumulated vals
- parts = [name, f'{kvn:02x}',] + labels
+ parts = [name, f'KVN{kvn:02x}',] + labels
cls_label = '-'.join(p for p in parts if p)
parts = ['Sd', 'Key', name, f'Kvn{kvn:02x}'] + labels
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41772?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: Ie296a438efd4737b39eaf133288ceed51bd593bc
Gerrit-Change-Number: 41772
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>