From b18c7d9be09882aee9b79f5b7d4f9bb51af97a09 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 20 Feb 2024 22:17:29 +0100 Subject: [PATCH] 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 --- pySim/esim/saip/personalization.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pySim/esim/saip/personalization.py b/pySim/esim/saip/personalization.py index 3dad2089..dc3435ba 100644 --- a/pySim/esim/saip/personalization.py +++ b/pySim/esim/saip/personalization.py @@ -77,7 +77,7 @@ class Iccid(ConfigurableParameter): 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)))