Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28762 )
Change subject: pySim-trace: Support SELECT with empty response body
......................................................................
Patch Set 1: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28762
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I66788717bec921bc54575e60f3f81adc80584dbc
Gerrit-Change-Number: 28762
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sun, 24 Jul 2022 11:35:11 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: laforge.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/pysim/+/28762 )
Change subject: pySim-trace: Support SELECT with empty response body
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28762
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I66788717bec921bc54575e60f3f81adc80584dbc
Gerrit-Change-Number: 28762
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Comment-Date: Sun, 24 Jul 2022 11:34:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28771 )
Change subject: client: Fix '-a' command-line argument for ATR
......................................................................
client: Fix '-a' command-line argument for ATR
The argument existed (as a long option), and was documented in the
user manual - but it wasn't printed in the help message, nor was it
present in the getopt_long() string.
Let's fix that.
Change-Id: Icfb74597dd813cee8b48b8dcf520fdd1c954338a
---
M src/client/remsim_client_main.c
1 file changed, 2 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/71/28771/1
diff --git a/src/client/remsim_client_main.c b/src/client/remsim_client_main.c
index e3d3cf8..4238864 100644
--- a/src/client/remsim_client_main.c
+++ b/src/client/remsim_client_main.c
@@ -32,6 +32,7 @@
" -p --server-port 13245 remsim-server TCP port\n"
" -c --client-id <0-1023> RSPRO ClientId of this client\n"
" -n --client-slot <0-1023> RSPRO SlotNr of this client\n"
+ " -a --atr HEXSTRING default ATR to simulate (until bankd overrides it)\n"
" -e --event-script <path> event script to be called by client\n"
#ifdef USB_SUPPORT
" -V --usb-vendor VENDOR_ID\n"
@@ -73,7 +74,7 @@
{ 0, 0, 0, 0 }
};
- c = getopt_long(argc, argv, "hvd:i:p:c:n:e:"
+ c = getopt_long(argc, argv, "hvd:i:p:c:n:a:e:"
#ifdef USB_SUPPORT
"V:P:C:I:S:A:H:"
#endif
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28771
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: Icfb74597dd813cee8b48b8dcf520fdd1c954338a
Gerrit-Change-Number: 28771
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
Attention is currently required from: laforge.
Hello Jenkins Builder, fixeria, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-remsim/+/28590
to look at the new patch set (#2).
Change subject: bankd: Open PC/SC by default in EXCLUSIVE mode
......................................................................
bankd: Open PC/SC by default in EXCLUSIVE mode
Let's open the cards in EXCLUSIVE mode, we don't want other applications
tinkering with the card state while we have a bankd worker running on
it. This change also means that no two bankd workers can trip on
each other accidentially anymore.
Related: OS#5527
Change-Id: I43a1c8c7bd1c0124ee5f605e2e5b04ed8f7836ab
---
M doc/manuals/chapters/remsim-bankd.adoc
M src/bankd/bankd.h
M src/bankd/bankd_main.c
M src/bankd/bankd_pcsc.c
4 files changed, 31 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/90/28590/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28590
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I43a1c8c7bd1c0124ee5f605e2e5b04ed8f7836ab
Gerrit-Change-Number: 28590
Gerrit-PatchSet: 2
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/28772 )
Change subject: client: Option to ignore any ATR sent by bankd
......................................................................
client: Option to ignore any ATR sent by bankd
This introduces an --atr-ignore-rspro command line argument, which
will make the remsim-client ignore any RSPRO setAtrReq it receives
from the remote bankd.
The purpose of this is to modify the capabilities advertised by the card
towards the UE (modem/phone). For example, by modifying the ATR
one can disable/constrain the UE from using higher bit rate support, or
disable the use of logical channels.
Change-Id: I930293f7b637dba60d9dd6d2254f4524f831b491
---
M doc/manuals/chapters/remsim-client.adoc
M src/client/client.h
M src/client/main_fsm.c
M src/client/remsim_client.c
M src/client/remsim_client_main.c
5 files changed, 24 insertions(+), 5 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/72/28772/1
diff --git a/doc/manuals/chapters/remsim-client.adoc b/doc/manuals/chapters/remsim-client.adoc
index d897431..f5d5550 100644
--- a/doc/manuals/chapters/remsim-client.adoc
+++ b/doc/manuals/chapters/remsim-client.adoc
@@ -93,7 +93,13 @@
*-a, --atr HEXSTRING*::
Specify the initial ATR to be communicated to the modem/phone. Can
and will later be overridden by the ATR as specified by
- `osmo-remsim-bankd` once a card has been mapped to this client.
+ `osmo-remsim-bankd` once a card has been mapped to this client, unless
+ the `--atr-ignore-rspro` option is also specified.
+*-r, --atr-ignore-rspro*::
+ Ignore any incoming RSPRO setAtrReq and always only use the locally-specified
+ ATR when communicating with the UE/modem/phone. This can be used to constrain
+ the capabilities advertised. This way, for example, the baud rate can be constrained,
+ or the use of logical channels prevented.
*-e, --event-script COMMAND*::
Specify the shell command to be execute when the client wants to call its
helper script
diff --git a/src/client/client.h b/src/client/client.h
index 9cfdc5d..8fcbcb3 100644
--- a/src/client/client.h
+++ b/src/client/client.h
@@ -73,6 +73,9 @@
uint8_t data[ATR_SIZE_MAX];
uint8_t len;
} atr;
+ /* ignore any ATR received via RSPRO; only use the hard-coded default or
+ * optionally the ATR given at the command line */
+ bool atr_ignore_rspro;
struct {
int vendor_id;
diff --git a/src/client/main_fsm.c b/src/client/main_fsm.c
index b79d061..1da0106 100644
--- a/src/client/main_fsm.c
+++ b/src/client/main_fsm.c
@@ -280,9 +280,13 @@
LOGPFSML(fi, LOGL_NOTICE, "Rx setAtrReq(%s)\n",
osmo_hexdump_nospc(pdu_rx->msg.choice.setAtrReq.atr.buf,
pdu_rx->msg.choice.setAtrReq.atr.size));
- /* forward to modem/cardem (via API) */
- frontend_handle_set_atr(bc, pdu_rx->msg.choice.setAtrReq.atr.buf,
- pdu_rx->msg.choice.setAtrReq.atr.size);
+ if (bc->cfg->atr_ignore_rspro) {
+ LOGPFSML(fi, LOGL_NOTICE, "Ignoring RSPRO setAtrReq\n");
+ } else {
+ /* forward to modem/cardem (via API) */
+ frontend_handle_set_atr(bc, pdu_rx->msg.choice.setAtrReq.atr.buf,
+ pdu_rx->msg.choice.setAtrReq.atr.size);
+ }
/* send response to bankd */
resp = rspro_gen_SetAtrRes(ResultCode_ok);
server_conn_send_rspro(&bc->bankd_conn, resp);
diff --git a/src/client/remsim_client.c b/src/client/remsim_client.c
index 247ae42..a5dc6c9 100644
--- a/src/client/remsim_client.c
+++ b/src/client/remsim_client.c
@@ -57,6 +57,7 @@
cfg->atr.data[0] = 0x3B;
cfg->atr.data[1] = 0x00; // the shortest simplest ATR possible
cfg->atr.len = 2;
+ cfg->atr_ignore_rspro = false;
return cfg;
};
diff --git a/src/client/remsim_client_main.c b/src/client/remsim_client_main.c
index 4238864..5a23d82 100644
--- a/src/client/remsim_client_main.c
+++ b/src/client/remsim_client_main.c
@@ -33,6 +33,7 @@
" -c --client-id <0-1023> RSPRO ClientId of this client\n"
" -n --client-slot <0-1023> RSPRO SlotNr of this client\n"
" -a --atr HEXSTRING default ATR to simulate (until bankd overrides it)\n"
+ " -r --atr-ignore-rspro Ignore any ATR from bankd; use only ATR given by -a)\n"
" -e --event-script <path> event script to be called by client\n"
#ifdef USB_SUPPORT
" -V --usb-vendor VENDOR_ID\n"
@@ -61,6 +62,7 @@
{ "client-id", 1, 0, 'c' },
{ "client-slot", 1, 0, 'n' },
{ "atr", 1, 0, 'a' },
+ { "atr-ignore-rspro", 0, 0, 'r' },
{ "event-script", 1, 0, 'e' },
#ifdef USB_SUPPORT
{ "usb-vendor", 1, 0, 'V' },
@@ -74,7 +76,7 @@
{ 0, 0, 0, 0 }
};
- c = getopt_long(argc, argv, "hvd:i:p:c:n:a:e:"
+ c = getopt_long(argc, argv, "hvd:i:p:c:n:a:re:"
#ifdef USB_SUPPORT
"V:P:C:I:S:A:H:"
#endif
@@ -114,6 +116,9 @@
exit(2);
}
break;
+ case 'r':
+ cfg->atr_ignore_rspro = true;
+ break;
case 'e':
osmo_talloc_replace_string(cfg, &cfg->event_script, optarg);
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/28772
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I930293f7b637dba60d9dd6d2254f4524f831b491
Gerrit-Change-Number: 28772
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28768 )
Change subject: filesystem: We can select not just immediate parent DF but all ancestors
......................................................................
filesystem: We can select not just immediate parent DF but all ancestors
I didn't check the specs, but at least experience with real-world cards
(and modems) shows that it's not just permitted to select the immediate
parent DF, but all ancestors of the currently selected file.
So adjust the get_selectables() method to not just return the immediate
parent, but to recurse all the way up and report the FID of any ancestor
DF.
Change-Id: Ic9037aa9a13af6fb0c2c22b673aa4afa78575b49
---
M pySim/filesystem.py
1 file changed, 14 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/28768/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 886a48d..513532e 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -194,6 +194,19 @@
sels.update({self.name: self})
return sels
+ def _get_parent_selectables(self, alias: str = None, flags=[]) -> Dict[str, 'CardFile']:
+ sels = {}
+ if not self.parent or self.parent == self:
+ return sels
+ # add our immediate parent
+ if self.parent.fid and (flags == [] or 'FIDS' in flags):
+ sels.update({self.parent.fid: self.parent})
+ if self.parent.name and (flags == [] or 'FNAMES' in flags):
+ sels.update({self.parent.name: self.parent})
+ # recurse to parents of our parent, but without any alias
+ sels.update(self.parent._get_parent_selectables(None, flags))
+ return sels
+
def get_selectables(self, flags=[]) -> Dict[str, 'CardFile']:
"""Return a dict of {'identifier': File} that is selectable from the current file.
@@ -210,8 +223,7 @@
sels = self._get_self_selectables('.', flags)
# we can always select our parent
if flags == [] or 'PARENT' in flags:
- if self.parent:
- sels = self.parent._get_self_selectables('..', flags)
+ sels.update(self._get_parent_selectables('..', flags))
# if we have a MF, we can always select its applications
if flags == [] or 'MF' in flags:
mf = self.get_mf()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28768
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ic9037aa9a13af6fb0c2c22b673aa4afa78575b49
Gerrit-Change-Number: 28768
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/28769 )
Change subject: apdu/ts_102_221: SELECT: allow select of parent/ancestor DFs
......................................................................
apdu/ts_102_221: SELECT: allow select of parent/ancestor DFs
We need to pass the 'PARENT' flag to get_selectables() to be able
to track SELECT on any of the parent/ancestor DF FID.
Change-Id: Ia7ac627d5edccb97160c90688d720d887fad6ec7
---
M pySim/apdu/ts_102_221.py
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/28769/1
diff --git a/pySim/apdu/ts_102_221.py b/pySim/apdu/ts_102_221.py
index 3597db8..769c38e 100644
--- a/pySim/apdu/ts_102_221.py
+++ b/pySim/apdu/ts_102_221.py
@@ -66,7 +66,7 @@
# iterate to next element in path
continue
else:
- sels = lchan.selected_file.get_selectables(['FIDS','MF'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT'])
if file_hex in sels:
if self.successful:
#print("\tSELECT %s" % sels[file_hex])
@@ -80,7 +80,7 @@
elif mode == 'df_ef_or_mf_by_file_id':
if len(self.cmd_data) != 2:
raise ValueError('Expecting a 2-byte FID')
- sels = lchan.selected_file.get_selectables(['FIDS','MF'])
+ sels = lchan.selected_file.get_selectables(['FIDS','MF','PARENT'])
file_hex = b2h(self.cmd_data)
if file_hex in sels:
if self.successful:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/28769
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ia7ac627d5edccb97160c90688d720d887fad6ec7
Gerrit-Change-Number: 28769
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange