Attention is currently required from: mqng2, fixeria.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/266 )
Change subject: lapdm: Fix malformed Abis messages
......................................................................
Patch Set 4:
(1 comment)
Patchset:
PS4:
OS#1635 claims it was fixed in https://gerrit.osmocom.org/c/libosmocore/+/3258
so it would make sense to explain why the above fix is insufficient and this additional fix is needed.
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/266
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Idbf43d4fdda6b2a6b4d8d15826735ce5f260ad89
Gerrit-Change-Number: 266
Gerrit-PatchSet: 4
Gerrit-Owner: mqng2 <minh-quang.nguyen(a)nutaq.com>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: mqng2 <minh-quang.nguyen(a)nutaq.com>
Gerrit-Attention: mqng2 <minh-quang.nguyen(a)nutaq.com>
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 21 Aug 2022 13:38:31 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: msuraev.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/29170 )
Change subject: SIGTRAN: add osmo_sccp_tx_disconn_data() helper
......................................................................
Patch Set 1: Code-Review+1
(1 comment)
File examples/sccp_test_vty.c:
https://gerrit.osmocom.org/c/libosmo-sccp/+/29170/comment/12971546_f86b0633
PS1, Line 97:
unrelated cosmetic change to the indent level. we can overlook it her as it's just some demo/example code.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/29170
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I92ae22d2cab5863245fba3d904a300055fda34fe
Gerrit-Change-Number: 29170
Gerrit-PatchSet: 1
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 21 Aug 2022 13:36:11 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: msuraev.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/29169 )
Change subject: Add basic readme for example code
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/29169
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I4c76a48a76ca9afc960ea2f08229bacc79b6fe77
Gerrit-Change-Number: 29169
Gerrit-PatchSet: 1
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 21 Aug 2022 13:35:13 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: msuraev.
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/29168 )
Change subject: SIGTRAN: error if attempting to send exceedingly big data
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/29168
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I8a67bc40080eb1405ab3b0df874e3ea20941a850
Gerrit-Change-Number: 29168
Gerrit-PatchSet: 1
Gerrit-Owner: msuraev <msuraev(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: msuraev <msuraev(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 21 Aug 2022 13:34:55 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has submitted this change. ( https://gerrit.osmocom.org/c/pysim/+/29067 )
Change subject: proactive: Send a Terminal Response automatically after a Fetch
......................................................................
proactive: Send a Terminal Response automatically after a Fetch
Change-Id: I43bc994e7517b5907fb40a98d84797c54056c47d
---
M pySim/transport/__init__.py
1 file changed, 43 insertions(+), 7 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index fb04209..09752ac 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -10,7 +10,7 @@
from pySim.exceptions import *
from pySim.construct import filter_dict
from pySim.utils import sw_match, b2h, h2b, i2h, Hexstr
-from pySim.cat import ProactiveCommand
+from pySim.cat import ProactiveCommand, CommandDetails, DeviceIdentities, Result
#
# Copyright (C) 2009-2010 Sylvain Munaut <tnt(a)246tNt.com>
@@ -42,10 +42,7 @@
"""Abstract base class representing the interface of some code that handles
the proactive commands, as returned by the card in responses to the FETCH
command."""
- def receive_fetch_raw(self, payload: Hexstr):
- # parse the proactive command
- pcmd = ProactiveCommand()
- parsed = pcmd.from_tlv(h2b(payload))
+ def receive_fetch_raw(self, pcmd: ProactiveCommand, parsed: Hexstr):
# try to find a generic handler like handle_SendShortMessage
handle_name = 'handle_%s' % type(parsed).__name__
if hasattr(self, handle_name):
@@ -167,11 +164,50 @@
# need not concern the caller.
rv = (rv[0], '9000')
# proactive sim as per TS 102 221 Setion 7.4.2
+ # TODO: Check SW manually to avoid recursing on the stack (provided this piece of code stays in this place)
fetch_rv = self.send_apdu_checksw('80120000' + last_sw[2:], sw)
+ # Setting this in case we later decide not to send a terminal
+ # response immediately unconditionally -- the card may still have
+ # something pending even though the last command was not processed
+ # yet.
last_sw = fetch_rv[1]
- print("FETCH: %s" % fetch_rv[0])
+ # parse the proactive command
+ pcmd = ProactiveCommand()
+ parsed = pcmd.from_tlv(h2b(fetch_rv[0]))
+ print("FETCH: %s (%s)" % (fetch_rv[0], type(parsed).__name__))
+ result = Result()
if self.proactive_handler:
- self.proactive_handler.receive_fetch_raw(fetch_rv[0])
+ # Extension point: If this does return a list of TLV objects,
+ # they could be appended after the Result; if the first is a
+ # Result, that cuold replace the one built here.
+ self.proactive_handler.receive_fetch_raw(pcmd, parsed)
+ result.from_dict({'general_result': 'performed_successfully', 'additional_information': ''})
+ else:
+ result.from_dict({'general_result': 'command_beyond_terminal_capability', 'additional_information': ''})
+
+ # Send response immediately, thus also flushing out any further
+ # proactive commands that the card already wants to send
+ #
+ # Structure as per TS 102 223 V4.4.0 Section 6.8
+
+ # The Command Details are echoed from the command that has been processed.
+ (command_details,) = [c for c in pcmd.decoded.children if isinstance(c, CommandDetails)]
+ # The Device Identities are fixed. (TS 102 223 V4.0.0 Section 6.8.2)
+ device_identities = DeviceIdentities()
+ device_identities.from_dict({'source_dev_id': 'terminal', 'dest_dev_id': 'uicc'})
+
+ # Testing hint: The value of tail does not influence the behavior
+ # of an SJA2 that sent ans SMS, so this is implemented only
+ # following TS 102 223, and not fully tested.
+ tail = command_details.to_tlv() + device_identities.to_tlv() + result.to_tlv()
+ # Testing hint: In contrast to the above, this part is positively
+ # essential to get the SJA2 to provide the later parts of a
+ # multipart SMS in response to an OTA RFM command.
+ terminal_response = '80140000' + b2h(len(tail).to_bytes(1, 'big') + tail)
+
+ terminal_response_rv = self.send_apdu(terminal_response)
+ last_sw = terminal_response_rv[1]
+
if not sw_match(rv[1], sw):
raise SwMatchError(rv[1], sw.lower(), self.sw_interpreter)
return rv
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/29067
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I43bc994e7517b5907fb40a98d84797c54056c47d
Gerrit-Change-Number: 29067
Gerrit-PatchSet: 2
Gerrit-Owner: Christian Amsüss <chrysn(a)fsfe.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/+/29066 )
Change subject: proactive: Avoid clobbering the output of the command that triggered the FETCH
......................................................................
proactive: Avoid clobbering the output of the command that triggered the FETCH
Change-Id: I2b794a5c5bc808b9703b4bc679c119341a0ed41c
---
M pySim/transport/__init__.py
1 file changed, 9 insertions(+), 4 deletions(-)
Approvals:
Jenkins Builder: Verified
fixeria: Looks good to me, but someone else must approve
laforge: Looks good to me, approved
diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 04e6b22..fb04209 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -160,13 +160,18 @@
sw : string (in hex) of status word (ex. "9000")
"""
rv = self.send_apdu(pdu)
+ last_sw = rv[1]
- while sw == '9000' and sw_match(rv[1], '91xx'):
+ while sw == '9000' and sw_match(last_sw, '91xx'):
+ # It *was* successful after all -- the extra pieces FETCH handled
+ # need not concern the caller.
+ rv = (rv[0], '9000')
# proactive sim as per TS 102 221 Setion 7.4.2
- rv = self.send_apdu_checksw('80120000' + rv[1][2:], sw)
- print("FETCH: %s" % rv[0])
+ fetch_rv = self.send_apdu_checksw('80120000' + last_sw[2:], sw)
+ last_sw = fetch_rv[1]
+ print("FETCH: %s" % fetch_rv[0])
if self.proactive_handler:
- self.proactive_handler.receive_fetch_raw(rv[0])
+ self.proactive_handler.receive_fetch_raw(fetch_rv[0])
if not sw_match(rv[1], sw):
raise SwMatchError(rv[1], sw.lower(), self.sw_interpreter)
return rv
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/29066
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I2b794a5c5bc808b9703b4bc679c119341a0ed41c
Gerrit-Change-Number: 29066
Gerrit-PatchSet: 2
Gerrit-Owner: Christian Amsüss <chrysn(a)fsfe.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: merged