Attention is currently required from: laforge.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/pysim/+/35424?usp=email
to look at the new patch set (#3).
The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder
Change subject: ts_31_103: Add construct for EF.GBABP and EF.GBANL
......................................................................
ts_31_103: Add construct for EF.GBABP and EF.GBANL
Change-Id: Ife06f54c2443f3e048bd36f706f309843703403a
---
M pySim/ts_31_103.py
1 file changed, 24 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/24/35424/3
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35424?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: Ife06f54c2443f3e048bd36f706f309843703403a
Gerrit-Change-Number: 35424
Gerrit-PatchSet: 3
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35459?usp=email )
Change subject: commands: Ignore exceptions during READ while UPDATE
......................................................................
commands: Ignore exceptions during READ while UPDATE
If we are reading a file to check if we can skip the write to conserve
writes, don't treat exceptions as fatal. The file may well have the
access mode in a way that permits us to UPDATE but not to READ. Simply
fall-back to unconditional UPDATE in this case.
Change-Id: I7bffdaa7596e63c8f0ab04a3cb3ebe12f137d3a8
---
M pySim/commands.py
1 file changed, 35 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/59/35459/1
diff --git a/pySim/commands.py b/pySim/commands.py
index 336cf0c..d785251 100644
--- a/pySim/commands.py
+++ b/pySim/commands.py
@@ -279,9 +279,16 @@
# Save write cycles by reading+comparing before write
if conserve:
- data_current, sw = self.read_binary(ef, data_length, offset)
- if data_current == data:
- return None, sw
+ try:
+ data_current, sw = self.read_binary(ef, data_length, offset)
+ if data_current == data:
+ return None, sw
+ except Exception:
+ # cannot read data. This is not a fatal error, as reading is just done to
+ # conserve the amount of smart card writes. The access conditions of the file
+ # may well permit us to UPDATE but not permit us to READ. So let's ignore
+ # any such exception during READ.
+ pass
self.select_path(ef)
total_data = ''
@@ -363,10 +370,17 @@
# Save write cycles by reading+comparing before write
if conserve:
- data_current, sw = self.read_record(ef, rec_no)
- data_current = data_current[0:rec_length*2]
- if data_current == data:
- return None, sw
+ try:
+ data_current, sw = self.read_record(ef, rec_no)
+ data_current = data_current[0:rec_length*2]
+ if data_current == data:
+ return None, sw
+ except Exception:
+ # cannot read data. This is not a fatal error, as reading is just done to
+ # conserve the amount of smart card writes. The access conditions of the file
+ # may well permit us to UPDATE but not permit us to READ. So let's ignore
+ # any such exception during READ.
+ pass
pdu = (self.cla_byte + 'dc%02x04%02x' % (rec_no, rec_length)) + data
res = self._tp.send_apdu_checksw(pdu)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35459?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: I7bffdaa7596e63c8f0ab04a3cb3ebe12f137d3a8
Gerrit-Change-Number: 35459
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: dexter, fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/35454?usp=email )
Change subject: ts_31_102: Implement decoders/encoders for EFs below DF.HNB
......................................................................
Patch Set 6:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35454?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: Ie57963381e928e2c1da408ad46549a780056242a
Gerrit-Change-Number: 35454
Gerrit-PatchSet: 6
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 28 Dec 2023 09:27:27 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/35455?usp=email )
Change subject: Fix TLV_IE_Collection.from_tlv in certain situations
......................................................................
Fix TLV_IE_Collection.from_tlv in certain situations
The existing code used to produce an empty output in situations where a
TLV_IE_Collection would be parsed from a single TLV only with some
additional trailing padding:
>>> from pySim.utils import h2b
>>> from pySim.ts_31_102 import EF_CSGT
>>> t = EF_CSGT.Csgt_TLV_Collection()
>>> t.from_tlv(h2b('8906810300666f6fff'))
[TextCsgType(foo)]
>>> t.to_dict()
[]
This was caused by an early return (actually returning the decoded
result) but *without updating self.children*.
Change-Id: I1c84ccf698c6ff7e7f14242f9aaf7d15ac2239f4
---
M pySim/tlv.py
1 file changed, 25 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/55/35455/1
diff --git a/pySim/tlv.py b/pySim/tlv.py
index 4ac5ebf..ccf049e 100644
--- a/pySim/tlv.py
+++ b/pySim/tlv.py
@@ -361,7 +361,7 @@
# obtain the tag at the start of the remainder
tag, r = first._parse_tag_raw(remainder)
if tag == None:
- return res
+ break
if tag in self.members_by_tag:
cls = self.members_by_tag[tag]
# create an instance and parse accordingly
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/35455?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: I1c84ccf698c6ff7e7f14242f9aaf7d15ac2239f4
Gerrit-Change-Number: 35455
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange