From 7d18f16e265f026f13a6904630e636417bcdd824 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 13 May 2026 15:59:02 +0200 Subject: [PATCH] personalization: SUCI: ff-pad remaining file size Change-Id: I9465eac9269e3f76dddd467109f547489a0feb93 --- pySim/esim/saip/personalization.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py index 0e88ec22..c87860aa 100644 --- a/pySim/esim/saip/personalization.py +++ b/pySim/esim/saip/personalization.py @@ -1344,7 +1344,15 @@ class SuciCalcInfoParameter(ConfigurableParameter): if not f_sucici: continue ef_sucici = EF_SUCI_Calc_Info() - f_sucici.body = ef_sucici.encode_bin(val) + body = ef_sucici.encode_bin(val) + + # 0xff pad up to the existing file size, so that the underlying template doesn't come through + is_size = f_sucici.file_size + pad_n = is_size - len(body) + if pad_n > 0: + body = body + b'\xff' * pad_n + + f_sucici.body = body pe.file2pe(f_sucici) @classmethod