aboutsummaryrefslogtreecommitdiffstats
path: root/pySim-shell.py
diff options
context:
space:
mode:
authorPhilipp Maier <pmaier@sysmocom.de>2023-10-16 15:02:07 +0200
committerlaforge <laforge@osmocom.org>2023-10-20 20:51:24 +0000
commit7c0cd0a93b87e1ee52ce6bccdb3a2a7ff3ee7be0 (patch)
tree04d4f25df116df9add5662046ea728a8c56b9566 /pySim-shell.py
parent509ecf84fa4d9e7d6806ad200bbfac9d12a01555 (diff)
pySim-shell: do not fail when EF.ICCID does not exist
An eUICC that has no active eSIM profile does not have an ICCID. (The reason for this is that EF.ICCID is part of the eSIM profile). Unfortunately pySim-shell insists on reading the ICCID from EF.ICCID on startup in order to use it as a lookup key for verify_adm later. To solve the problem, let's add a try/except block around the section where EF.ICCID is read. In case of failure we set the ICCID to None, Related: OS#5636 Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Diffstat (limited to 'pySim-shell.py')
-rwxr-xr-xpySim-shell.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/pySim-shell.py b/pySim-shell.py
index afc7653..a79949c 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -244,8 +244,11 @@ class PysimApp(Cmd2Compat):
self.register_command_set(Ts102222Commands())
self.register_command_set(PySimCommands())
- self.lchan.select('MF/EF.ICCID', self)
- self.iccid = dec_iccid(self.lchan.read_binary()[0])
+ try:
+ self.lchan.select('MF/EF.ICCID', self)
+ self.iccid = dec_iccid(self.lchan.read_binary()[0])
+ except:
+ self.iccid = None
self.lchan.select('MF', self)
rc = True