laforge submitted this change.

View Change


Approvals: laforge: Looks good to me, approved Jenkins Builder: Verified
saip.personalization: Fix encoding of ICCID in ProfileHeader

To make things exciting, they decided that the ICCID in the profile
header is encoded different from the ICCID contained in EF.ICCID...

Change-Id: I5eacdcdc6bd0ada431eb047bfae930d79d6e3af8
---
M pySim/esim/saip/personalization.py
1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py
index 3dad208..dc3435b 100644
--- a/pySim/esim/saip/personalization.py
+++ b/pySim/esim/saip/personalization.py
@@ -77,7 +77,7 @@

def apply(self, pes: ProfileElementSequence):
# patch the header
- pes.get_pe_for_type('header').decoded['iccid'] = self.value
+ pes.get_pe_for_type('header').decoded['iccid'] = h2b(rpad(self.value, 20))
# patch MF/EF.ICCID
file_replace_content(pes.get_pe_for_type('mf').decoded['ef-iccid'], h2b(enc_iccid(self.value)))


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5eacdcdc6bd0ada431eb047bfae930d79d6e3af8
Gerrit-Change-Number: 36028
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge@osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-MessageType: merged