BatchPersonalization: run validation.CheckBasicStructure on each PES

Change-Id: I0e4aa6b0c62552d95feee62948e0cb0bb8c6d8ef
This commit is contained in:
Neels Hofmeyr
2026-01-14 01:49:53 +01:00
parent 3662285b4b
commit 575d1a3158

View File

@@ -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 ProfileElement, ProfileElementSD, ProfileElementSequence
from pySim.esim.saip import SecurityDomainKey, SecurityDomainKeyComponent
from pySim.esim.saip import validation
from pySim.global_platform import KeyUsageQualifier, KeyType
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}'
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