fixeria has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42384?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: utils: DataObjectCollection.encode(): fix TypeError
......................................................................
utils: DataObjectCollection.encode(): fix TypeError
`members_by_name` is a plain dictionary. Calling it with `()` raises:
TypeError: 'dict' object is not callable
Change-Id: I7e0c09aa7303f1506fe3a025fdc3779919dd0e6c
---
M pySim/utils.py
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
daniel: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/utils.py b/pySim/utils.py
index 0417366..519d73c 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -910,7 +910,8 @@
def encode(self, decoded) -> bytes:
res = bytearray()
for i in decoded:
- obj = self.members_by_name(i[0])
+ name = i[0]
+ obj = self.members_by_name[name]
res.append(obj.to_tlv())
return res
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42384?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I7e0c09aa7303f1506fe3a025fdc3779919dd0e6c
Gerrit-Change-Number: 42384
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42382?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: ota: OtaAlgo{Crypt,Auth}: fix algo_auth vs algo_crypt
......................................................................
ota: OtaAlgo{Crypt,Auth}: fix algo_auth vs algo_crypt
* OtaAlgoCrypt.from_keyset() searches by `otak.algo_crypt`
but the error message prints `otak.algo_auth`. Should be
`otak.algo_crypt` instead.
* OtaAlgoAuth.__init__() checks `algo_auth` but the error message
prints `algo_crypt`. Should be `otak.algo_auth` instead.
Change-Id: Ia636fffaeadc68e3f6d5b65d477e753834c95895
---
M pySim/ota.py
1 file changed, 2 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
daniel: Looks good to me, but someone else must approve
Jenkins Builder: Verified
fixeria: Looks good to me, approved
diff --git a/pySim/ota.py b/pySim/ota.py
index fbb9d45..3d2da15 100644
--- a/pySim/ota.py
+++ b/pySim/ota.py
@@ -221,12 +221,12 @@
for subc in cls.__subclasses__():
if subc.enum_name == otak.algo_crypt:
return subc(otak)
- raise ValueError('No implementation for crypt algorithm %s' % otak.algo_auth)
+ raise ValueError('No implementation for crypt algorithm %s' % otak.algo_crypt)
class OtaAlgoAuth(OtaAlgo, abc.ABC):
def __init__(self, otak: OtaKeyset):
if self.enum_name != otak.algo_auth:
- raise ValueError('Cannot use algorithm %s with key for %s' % (self.enum_name, otak.algo_crypt))
+ raise ValueError('Cannot use algorithm %s with key for %s' % (self.enum_name, otak.algo_auth))
super().__init__(otak)
def sign(self, data:bytes) -> bytes:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42382?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia636fffaeadc68e3f6d5b65d477e753834c95895
Gerrit-Change-Number: 42382
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42381?usp=email )
(
3 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: sms: fix flags_construct in SMS_DELIVER
......................................................................
sms: fix flags_construct in SMS_DELIVER
* field `tp_rp` appears at bit positions 7 and 5
** bit 7 should be `tp_rp` (Reply Path)
** bit 5 should be `tp_sri` (Status Report Indication)
* field `tp_lp` is completely missing
** should be at bit position 3
Change-Id: I0274849f0fa07281b5e050af429ffda7d249f9e8
---
M pySim/sms.py
1 file changed, 8 insertions(+), 2 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
daniel: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/sms.py b/pySim/sms.py
index aefc874..62601b0 100644
--- a/pySim/sms.py
+++ b/pySim/sms.py
@@ -169,8 +169,14 @@
class SMS_DELIVER(SMS_TPDU):
"""Representation of a SMS-DELIVER T-PDU. This is the Network to MS/UE (downlink) direction."""
- flags_construct = BitStruct('tp_rp'/Flag, 'tp_udhi'/Flag, 'tp_rp'/Flag, 'tp_sri'/Flag,
- Padding(1), 'tp_mms'/Flag, 'tp_mti'/BitsInteger(2))
+ flags_construct = BitStruct('tp_rp'/Flag,
+ 'tp_udhi'/Flag,
+ 'tp_sri'/Flag,
+ Padding(1),
+ 'tp_lp'/Flag,
+ 'tp_mms'/Flag,
+ 'tp_mti'/BitsInteger(2))
+
def __init__(self, **kwargs):
kwargs['tp_mti'] = 0
super().__init__(**kwargs)
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42381?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I0274849f0fa07281b5e050af429ffda7d249f9e8
Gerrit-Change-Number: 42381
Gerrit-PatchSet: 5
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
fixeria has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/42377?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: global_platform: fix docstring for Scp03SessionKeys._get_icv()
......................................................................
global_platform: fix docstring for Scp03SessionKeys._get_icv()
Change-Id: I8983bc27f581295544360ba8b4ae1d28b3ea850f
---
M pySim/global_platform/scp.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, but someone else must approve
daniel: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/pySim/global_platform/scp.py b/pySim/global_platform/scp.py
index 124b4c5..6c267fa 100644
--- a/pySim/global_platform/scp.py
+++ b/pySim/global_platform/scp.py
@@ -438,7 +438,7 @@
"""Obtain the ICV value computed as described in 6.2.6.
This method has two modes:
* is_response=False for computing the ICV for C-ENC. Will pre-increment the counter.
- * is_response=False for computing the ICV for R-DEC."""
+ * is_response=True for computing the ICV for R-DEC."""
if not is_response:
self.block_nr += 1
# The binary value of this number SHALL be left padded with zeroes to form a full block.
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/42377?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8983bc27f581295544360ba8b4ae1d28b3ea850f
Gerrit-Change-Number: 42377
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>