mirror of
https://gitea.osmocom.org/sim-card/pysim.git
synced 2026-03-30 08:40:00 +03:00
BatchPersonalization: run validation.CheckBasicStructure on each PES
Change-Id: I0e4aa6b0c62552d95feee62948e0cb0bb8c6d8ef
This commit is contained in:
@@ -29,6 +29,7 @@ from pySim.utils import enc_iccid, dec_iccid, enc_imsi, dec_imsi, h2b, b2h, rpad
|
|||||||
from pySim.esim.saip import param_source
|
from pySim.esim.saip import param_source
|
||||||
from pySim.esim.saip import ProfileElement, ProfileElementSD, ProfileElementSequence
|
from pySim.esim.saip import ProfileElement, ProfileElementSD, ProfileElementSequence
|
||||||
from pySim.esim.saip import SecurityDomainKey, SecurityDomainKeyComponent
|
from pySim.esim.saip import SecurityDomainKey, SecurityDomainKeyComponent
|
||||||
|
from pySim.esim.saip import validation
|
||||||
from pySim.global_platform import KeyUsageQualifier, KeyType
|
from pySim.global_platform import KeyUsageQualifier, KeyType
|
||||||
|
|
||||||
def unrpad(s: hexstr, c='f') -> hexstr:
|
def unrpad(s: hexstr, c='f') -> hexstr:
|
||||||
@@ -1222,6 +1223,12 @@ class BatchPersonalization:
|
|||||||
raise ValueError(f'{p.param.name} fed by {p.src.name}: {e}'
|
raise ValueError(f'{p.param.name} fed by {p.src.name}: {e}'
|
||||||
f' (input_value={p.param.input_value!r} value={p.param.value!r})') from e
|
f' (input_value={p.param.input_value!r} value={p.param.value!r})') from e
|
||||||
|
|
||||||
|
try:
|
||||||
|
c = validation.CheckBasicStructure()
|
||||||
|
c.check(pes)
|
||||||
|
except validation.ProfileError as e:
|
||||||
|
raise ValueError(f'generated profile index {i} does not pass basic structural checks: {e}') from e
|
||||||
|
|
||||||
yield pes
|
yield pes
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user