[S] Change in pysim[master]: pySim-shell: do not fail when EF.ICCID does not exist

2023-10-20 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34768?usp=email )

Change subject: pySim-shell: do not fail when EF.ICCID does not exist
..

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
---
M pySim-shell.py
1 file changed, 23 insertions(+), 2 deletions(-)

Approvals:
  osmith: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




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 @@
 self.register_command_set(Ts10Commands())
 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

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Gerrit-Change-Number: 34768
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in pysim[master]: pySim-shell: do not fail when EF.ICCID does not exist

2023-10-20 Thread laforge
Attention is currently required from: dexter, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34768?usp=email )

Change subject: pySim-shell: do not fail when EF.ICCID does not exist
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Gerrit-Change-Number: 34768
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 20 Oct 2023 20:51:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: pySim-shell: do not fail when EF.ICCID does not exist

2023-10-20 Thread osmith
Attention is currently required from: dexter, pespin.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34768?usp=email )

Change subject: pySim-shell: do not fail when EF.ICCID does not exist
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Gerrit-Change-Number: 34768
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 20 Oct 2023 09:16:54 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: pySim-shell: do not fail when EF.ICCID does not exist

2023-10-16 Thread fixeria
Attention is currently required from: dexter.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34768?usp=email )

Change subject: pySim-shell: do not fail when EF.ICCID does not exist
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Gerrit-Change-Number: 34768
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Mon, 16 Oct 2023 14:49:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in pysim[master]: pySim-shell: do not fail when EF.ICCID does not exist

2023-10-16 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34768?usp=email )


Change subject: pySim-shell: do not fail when EF.ICCID does not exist
..

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
---
M pySim-shell.py
1 file changed, 23 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/34768/1

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 @@
 self.register_command_set(Ts10Commands())
 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

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8d18c5073946c5a6bb1f93be0ce692a599f46f8c
Gerrit-Change-Number: 34768
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-MessageType: newchange