Compare commits

...

5 Commits

Author SHA1 Message Date
Neels Hofmeyr 4364309ec7 saip.SdKey*: transitional name mapping
To help existing applications transition to a common naming scheme for
the SdKey classes, offer this intermediate result, where the SdKey
classes' .name are still unchanged as before generating them.

Change-Id: I974cb6c393a2ed2248a6240c2722d157e9235c33
Jenkins: skip-card-test
2026-08-19 02:23:13 +02:00
Neels Hofmeyr b19fbc7a07 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
2026-08-19 02:21:32 +02:00
Neels Hofmeyr 9a7d83da3d typo 'concetenation' in personalization.py
Change-Id: I51345db014335e8a70a7437a9cad5a3e47570a95
Jenkins: skip-card-test
2026-08-19 02:19:34 +02:00
Neels Hofmeyr 925573f4d7 test_configurable_parameters: test less templates
Change-Id: Ib75b6919a3acfddd99bf9baa9b6847ef731b9e67
Jenkins: skip-card-test
2026-08-19 02:14:49 +02:00
Neels Hofmeyr 9d08268bc4 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
2026-08-19 02:04:43 +02:00
5 changed files with 186 additions and 1560 deletions
+2
View File
@@ -123,6 +123,8 @@ class BatchPersonalization:
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
+27 -1
View File
@@ -873,6 +873,30 @@ class SdKey(BinaryParam):
SdKey.all_implementations = []
transitional_name_mapping = {
'SCP02-KVN20-AES-DEK': 'SCP02-20-AES-DEK',
'SCP02-KVN20-AES-ENC': 'SCP02-20-AES-ENC',
'SCP02-KVN20-AES-MAC': 'SCP02-20-AES-MAC',
'SCP02-KVN21-AES-DEK': 'SCP02-21-AES-DEK',
'SCP02-KVN21-AES-ENC': 'SCP02-21-AES-ENC',
'SCP02-KVN21-AES-MAC': 'SCP02-21-AES-MAC',
'SCP02-KVN22-AES-DEK': 'SCP02-22-AES-DEK',
'SCP02-KVN22-AES-ENC': 'SCP02-22-AES-ENC',
'SCP02-KVN22-AES-MAC': 'SCP02-22-AES-MAC',
'SCP02-KVNff-AES-DEK': 'SCP02-ff-AES-DEK',
'SCP02-KVNff-AES-ENC': 'SCP02-ff-AES-ENC',
'SCP02-KVNff-AES-MAC': 'SCP02-ff-AES-MAC',
'SCP03-KVN30-AES-DEK': 'SCP03-30-AES-DEK',
'SCP03-KVN30-AES-ENC': 'SCP03-30-AES-ENC',
'SCP03-KVN30-AES-MAC': 'SCP03-30-AES-MAC',
'SCP03-KVN31-AES-DEK': 'SCP03-31-AES-DEK',
'SCP03-KVN31-AES-ENC': 'SCP03-31-AES-ENC',
'SCP03-KVN31-AES-MAC': 'SCP03-31-AES-MAC',
'SCP03-KVN32-AES-DEK': 'SCP03-32-AES-DEK',
'SCP03-KVN32-AES-ENC': 'SCP03-32-AES-ENC',
'SCP03-KVN32-AES-MAC': 'SCP03-32-AES-MAC',
}
def camel(s):
return s[:1].upper() + s[1:].lower()
@@ -904,6 +928,8 @@ class SdKey(BinaryParam):
max_key_len = attrs.get('allow_len')[-1]
cls_label = transitional_name_mapping.get(cls_label, cls_label)
attrs.update({
'name' : cls_label,
'kvn': kvn,
@@ -1156,7 +1182,7 @@ class MilenageRotationConstants(BinaryParam, AlgoConfig):
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
+1 -1
View File
@@ -335,7 +335,7 @@ class EF_SUCI_Calc_Info(TransparentEF):
"""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}
@@ -55,8 +55,6 @@ class ConfigurableParameterTest(unittest.TestCase):
upp_fnames = (
'TS48v5_SAIP2.1A_NoBERTLV.der',
'TS48v5_SAIP2.3_BERTLV_SUCI.der',
'TS48v5_SAIP2.1B_NoBERTLV.der',
'TS48v5_SAIP2.3_NoBERTLV.der',
)
class Paramtest:
File diff suppressed because it is too large Load Diff