laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/42122?usp=email )


Change subject: pySim.esim.saip.File: Support pinStatusTemplateDO + lcsi
......................................................................

pySim.esim.saip.File: Support pinStatusTemplateDO + lcsi

The tuples defining a DF or ADF in an eSIM template must contain a
pinStatusTemplateDO.  When parsing tuples into a File() instance, we
must save it, and re-create it at the time we re-encode that file.

Same applies to the lcsi (life cycle state indicator), which may
optionally exist for any file.

Change-Id: I073aa4374f2cd664d07fa0224bf0d4c809cdf4aa
Closes: OS#6955
---
M pySim/esim/saip/__init__.py
1 file changed, 8 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/22/42122/1

diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index a50e86f..bdbbccf 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -151,6 +151,8 @@
         self.df_name = None
         self.fill_pattern = None
         self.fill_pattern_repeat = False
+        self.pstdo = None # pinStatusTemplateDO, mandatory for DF/ADF
+        self.lcsi = None # optional life cycle status indicator
         # apply some defaults from profile
         if self.template:
             self.from_template(self.template)
@@ -278,6 +280,8 @@
         elif self.file_type in ['MF', 'DF', 'ADF']:
             fdb_dec['file_type'] = 'df'
             fdb_dec['structure'] = 'no_info_given'
+            # pinStatusTemplateDO is mandatory for DF/ADF
+            fileDescriptor['pinStatusTemplateDO'] = self.pstdo
         # build file descriptor based on above input data
         fd_dict = {}
         if len(fdb_dec):
@@ -304,6 +308,8 @@
             # desired fill or repeat pattern in the "proprietaryEFInfo" 
element for the EF in Profiles
             # downloaded to a V2.2 or earlier eUICC.
             fileDescriptor['proprietaryEFInfo'] = pefi
+        if self.lcsi:
+            fileDescriptor['lcsi'] = self.lcsi
         logger.debug("%s: to_fileDescriptor(%s)" % (self, fileDescriptor))
         return fileDescriptor

@@ -323,6 +329,8 @@
         if efFileSize:
             self._file_size = self._decode_file_size(efFileSize)

+        self.pstdo = fileDescriptor.get('pinStatusTemplateDO', None)
+        self.lcsi = fileDescriptor.get('lcsi', None)
         pefi = fileDescriptor.get('proprietaryEFInfo', {})
         securityAttributesReferenced = 
fileDescriptor.get('securityAttributesReferenced', None)
         if securityAttributesReferenced:

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42122?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I073aa4374f2cd664d07fa0224bf0d4c809cdf4aa
Gerrit-Change-Number: 42122
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <[email protected]>

Reply via email to