neels has uploaded this change for review.

View Change

personalization: SUCI: ff-pad remaining file size

Change-Id: I9465eac9269e3f76dddd467109f547489a0feb93
Jenkins: skip-card-test
---
M pySim/esim/saip/personalization.py
1 file changed, 9 insertions(+), 1 deletion(-)

git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/66/43866/1
diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index a81c61f..a3347cb 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -1334,7 +1334,15 @@
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

To view, visit change 43866. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I9465eac9269e3f76dddd467109f547489a0feb93
Gerrit-Change-Number: 43866
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr@sysmocom.de>