laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36902?usp=email )
Change subject: osmo-smdpp.py: Resolve possible variable use before assignment
......................................................................
osmo-smdpp.py: Resolve possible variable use before assignment
osmo-smdpp.py:374:72: E0601: Using variable 'iccid_str' before assignment (used-before-assignment)
Let's raise an exception in the erroneous case.
Change-Id: I01b308226e12f91699b1b5c6bb06f853be47e185
---
M osmo-smdpp.py
1 file changed, 16 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/osmo-smdpp.py b/osmo-smdpp.py
index 1f4311d..3dc6131 100755
--- a/osmo-smdpp.py
+++ b/osmo-smdpp.py
@@ -368,6 +368,9 @@
pes = saip.ProfileElementSequence.from_der(f.read())
iccid_str = b2h(pes.get_pe_for_type('header').decoded['iccid'])
+ # make pylint happy: E0601: Using variable 'iccid_str' before assignment (used-before-assignment)
+ assert iccid_str
+
# FIXME: we actually want to perform the profile binding herr, and read the profile metadat from the profile
# Put together profileMetadata + _bin
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36902?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: I01b308226e12f91699b1b5c6bb06f853be47e185
Gerrit-Change-Number: 36902
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36837?usp=email )
(
2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: euicc: clarify which eUICCs are supported
......................................................................
euicc: clarify which eUICCs are supported
We currently do not support M2M eUICC
Change-Id: I3deb9f181075411484158471012ed449c83028fa
---
M pySim/euicc.py
1 file changed, 15 insertions(+), 2 deletions(-)
Approvals:
lynxis lazus: Looks good to me, approved
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/pySim/euicc.py b/pySim/euicc.py
index 7f4cdda..1683cac 100644
--- a/pySim/euicc.py
+++ b/pySim/euicc.py
@@ -1,9 +1,11 @@
# -*- coding: utf-8 -*-
"""
-Various definitions related to GSMA eSIM / eUICC
+Various definitions related to GSMA consumer + IoT eSIM / eUICC
-Related Specs: GSMA SGP.22, GSMA SGP.02, etc.
+Does *not* implement anything related to M2M eUICC
+
+Related Specs: GSMA SGP.21, SGP.22, SGP.31, SGP32
"""
# Copyright (C) 2023 Harald Welte <laforge(a)osmocom.org>
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36837?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: I3deb9f181075411484158471012ed449c83028fa
Gerrit-Change-Number: 36837
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36899?usp=email )
Change subject: commands.py: Resolve possible variable use before assignment
......................................................................
commands.py: Resolve possible variable use before assignment
pySim/commands.py:223:18: E0606: Possibly using variable 'skip' before assignment (possibly-used-before-assignment)
Let's raise an exception in the erroneous case.
Change-Id: Id1a892c3446e472699e77f076c2414277e92c98d
---
M pySim/commands.py
1 file changed, 15 insertions(+), 0 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/commands.py b/pySim/commands.py
index 9a49124..08537bd 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -211,6 +211,7 @@
# checking if the length of the remaining TLV string matches
# what we get in the length field.
# See also ETSI TS 102 221, chapter 11.1.1.3.0 Base coding.
+ # TODO: this likely just is normal BER-TLV ("All data objects are BER-TLV except if otherwise # defined.")
exp_tlv_len = int(fcp[2:4], 16)
if len(fcp[4:]) // 2 == exp_tlv_len:
skip = 4
@@ -218,6 +219,7 @@
exp_tlv_len = int(fcp[2:6], 16)
if len(fcp[4:]) // 2 == exp_tlv_len:
skip = 6
+ raise ValueError('Cannot determine length of TLV-length')
# Skip FCP tag and length
tlv = fcp[skip:]
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36899?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: Id1a892c3446e472699e77f076c2414277e92c98d
Gerrit-Change-Number: 36899
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/36901?usp=email )
Change subject: euicc.py: Resolve possible variable use before assignment
......................................................................
euicc.py: Resolve possible variable use before assignment
pySim/euicc.py:436:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)
pySim/euicc.py:455:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)
pySim/euicc.py:473:31: E0606: Possibly using variable 'p_id' before assignment (possibly-used-before-assignment)
Let's raise an exception in the erroneous case.
Change-Id: Ifdf4651e503bae6ea3e91c89c2121b416a12fb1a
---
M pySim/euicc.py
1 file changed, 27 insertions(+), 3 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/euicc.py b/pySim/euicc.py
index c27c91f..7f4cdda 100644
--- a/pySim/euicc.py
+++ b/pySim/euicc.py
@@ -429,8 +429,11 @@
"""Perform an ES10c EnableProfile function."""
if opts.isdp_aid:
p_id = ProfileIdentifier(children=[IsdpAid(decoded=opts.isdp_aid)])
- if opts.iccid:
+ elif opts.iccid:
p_id = ProfileIdentifier(children=[Iccid(decoded=opts.iccid)])
+ else:
+ # this is guaranteed by argparse; but we need this to make pylint happy
+ raise ValueError('Either ISD-P AID or ICCID must be given')
ep_cmd_contents = [p_id, RefreshFlag(decoded=opts.refresh_required)]
ep_cmd = EnableProfileReq(children=ep_cmd_contents)
ep = CardApplicationISDR.store_data_tlv(self._cmd.lchan.scc, ep_cmd, EnableProfileResp)
@@ -448,8 +451,11 @@
"""Perform an ES10c DisableProfile function."""
if opts.isdp_aid:
p_id = ProfileIdentifier(children=[IsdpAid(decoded=opts.isdp_aid)])
- if opts.iccid:
+ elif opts.iccid:
p_id = ProfileIdentifier(children=[Iccid(decoded=opts.iccid)])
+ else:
+ # this is guaranteed by argparse; but we need this to make pylint happy
+ raise ValueError('Either ISD-P AID or ICCID must be given')
dp_cmd_contents = [p_id, RefreshFlag(decoded=opts.refresh_required)]
dp_cmd = DisableProfileReq(children=dp_cmd_contents)
dp = CardApplicationISDR.store_data_tlv(self._cmd.lchan.scc, dp_cmd, DisableProfileResp)
@@ -466,8 +472,11 @@
"""Perform an ES10c DeleteProfile function."""
if opts.isdp_aid:
p_id = IsdpAid(decoded=opts.isdp_aid)
- if opts.iccid:
+ elif opts.iccid:
p_id = Iccid(decoded=opts.iccid)
+ else:
+ # this is guaranteed by argparse; but we need this to make pylint happy
+ raise ValueError('Either ISD-P AID or ICCID must be given')
dp_cmd_contents = [p_id]
dp_cmd = DeleteProfileReq(children=dp_cmd_contents)
dp = CardApplicationISDR.store_data_tlv(self._cmd.lchan.scc, dp_cmd, DeleteProfileResp)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36901?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: Ifdf4651e503bae6ea3e91c89c2121b416a12fb1a
Gerrit-Change-Number: 36901
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36904?usp=email )
Change subject: pySim-trace.py: Resolve possible variable use before assignment
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36904?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: I28c137a20143b2cd6ea9a0d5461ab61fcd6fe935
Gerrit-Change-Number: 36904
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 23 May 2024 14:48:34 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36903?usp=email )
Change subject: pySim-prog.py: Resolve possible variable use before assignment
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36903?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: I6ab307db378d2ca76dfeae53dc3befa7c103974d
Gerrit-Change-Number: 36903
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 23 May 2024 14:48:33 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/36902?usp=email )
Change subject: osmo-smdpp.py: Resolve possible variable use before assignment
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/36902?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: I01b308226e12f91699b1b5c6bb06f853be47e185
Gerrit-Change-Number: 36902
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Thu, 23 May 2024 14:48:31 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment