Change in osmo-ccid-firmware[master]: ccid: do not allow xfers with inactive slotws

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Hoernchen gerrit-no-reply at lists.osmocom.org
Sat Nov 7 18:42:24 UTC 2020


Hoernchen has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/21070 )


Change subject: ccid: do not allow xfers with inactive slotws
......................................................................

ccid: do not allow xfers with inactive slotws

pcscd tries to do this if the previous command led to a deactivation...

Change-Id: If2659c7d5e8784e5e4393d5b12589e96d517168a
---
M ccid_common/ccid_device.c
M ccid_common/ccid_slot_fsm.c
2 files changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/70/21070/1

diff --git a/ccid_common/ccid_device.c b/ccid_common/ccid_device.c
index fe21414..7819d41 100644
--- a/ccid_common/ccid_device.c
+++ b/ccid_common/ccid_device.c
@@ -462,7 +462,7 @@
 
 	/* handle this asynchronously */
 	rc = cs->ci->slot_ops->xfr_block_async(cs, msg, &u->xfr_block);
-	if (rc < 0) {
+	if (rc <= 0) {
 		msgb_trim(msg, sizeof(struct ccid_rdr_to_pc_data_block));
 		resp = ccid_gen_data_block(cs, u->xfr_block.hdr.bSeq, CCID_CMD_STATUS_FAILED, -rc, 0, 0);
 		goto out;
diff --git a/ccid_common/ccid_slot_fsm.c b/ccid_common/ccid_slot_fsm.c
index af5b713..043fa8f 100644
--- a/ccid_common/ccid_slot_fsm.c
+++ b/ccid_common/ccid_slot_fsm.c
@@ -302,12 +302,16 @@
 	if (msgb_length(msg) != xfb->hdr.dwLength + 10)
 		return -1;
 
+	/* might be unpowered after failed ppss that led to reset */
+	if (cs->icc_powered != true)
+		return -0;
+
 	msgb_pull(msg, 10);
 
 	LOGPCS(cs, LOGL_DEBUG, "scheduling TPDU transfer: %s\n", msgb_hexdump(msg));
 	osmo_fsm_inst_dispatch(ss->fi, ISO7816_E_XCEIVE_TPDU_CMD, msg);
 	/* continues in iso_fsm_clot_user_cb once response/error/timeout is received */
-	return 0;
+	return 1;
 }
 
 

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-ccid-firmware/+/21070
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-Change-Id: If2659c7d5e8784e5e4393d5b12589e96d517168a
Gerrit-Change-Number: 21070
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen <ewild at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201107/b6dd84e6/attachment.htm>


More information about the gerrit-log mailing list