lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-remsim/+/43351?usp=email )
Change subject: client: simtrace2: Use the new API osmo_apdu_segment_in2()
......................................................................
client: simtrace2: Use the new API osmo_apdu_segment_in2()
The old osmo_apdu_segment_in() could not parse GP GET DATA correctly
and will fail when parsing a GP GET DATA case 2 with an Le != 0.
Related: SYS#8147
Change-Id: I432c96c8cdbcb78bc3e4f135ebd51c4077aa9007
---
M src/client/user_simtrace2.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-remsim refs/changes/51/43351/1
diff --git a/src/client/user_simtrace2.c b/src/client/user_simtrace2.c
index 2535efb..0abd268 100644
--- a/src/client/user_simtrace2.c
+++ b/src/client/user_simtrace2.c
@@ -82,7 +82,7 @@
return 0;
}
-static struct osmo_apdu_context ac; // this will hold the complete APDU (across calls)
+static struct osmo_apdu_context ac, prev_ac; // this will hold the complete APDU and previous APDU (across calls)
/*! \brief Process a RX-DATA indication message from the SIMtrace2 */
static int process_do_rx_da(struct osmo_st2_cardem_inst *ci, uint8_t *buf, int len)
@@ -96,8 +96,8 @@
osmo_hexdump(data->data, data->data_len));
/* parse the APDU data in the USB message */
- rc = osmo_apdu_segment_in(&ac, data->data, data->data_len,
- data->flags & CEMU_DATA_F_TPDU_HDR);
+ rc = osmo_apdu_segment_in2(&ac, &prev_ac, data->data, data->data_len,
+ data->flags & CEMU_DATA_F_TPDU_HDR);
if (rc & APDU_ACT_TX_CAPDU_TO_CARD) {
/* there is no pending data coming from the modem */
--
To view, visit https://gerrit.osmocom.org/c/osmo-remsim/+/43351?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I432c96c8cdbcb78bc3e4f135ebd51c4077aa9007
Gerrit-Change-Number: 43351
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>
lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/43350?usp=email )
Change subject: simtrace2-cardem-pcsc: use new API osmo_apdu_segment_in2() to fix GP GET DATA
......................................................................
simtrace2-cardem-pcsc: use new API osmo_apdu_segment_in2() to fix GP GET DATA
The old osmo_apdu_segment_in() could not parse GP GET DATA correctly
and will fail when parsing a GP GET DATA case 2 with an Le != 0.
Related: SYS#8147
Change-Id: Id5642cb76da4fcbcdd318d41691415781bf0bc50
---
M host/src/simtrace2-cardem-pcsc.c
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/50/43350/1
diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c
index f26698e..1f5c46d 100644
--- a/host/src/simtrace2-cardem-pcsc.c
+++ b/host/src/simtrace2-cardem-pcsc.c
@@ -159,7 +159,7 @@
/*! \brief Process a RX-DATA indication message from the SIMtrace2 */
static int process_do_rx_da(struct osmo_st2_cardem_inst *ci, uint8_t *buf, int len)
{
- static struct osmo_apdu_context ac;
+ static struct osmo_apdu_context ac, prev_ac;
struct cardemu_usb_msg_rx_data *data;
int rc;
@@ -168,8 +168,8 @@
LOGCI(ci, LOGL_INFO, "=> DATA: flags=0x%02x (%s), %s\n ", data->flags,
cemu_data_flags2str(data->flags), osmo_hexdump(data->data, data->data_len));
- rc = osmo_apdu_segment_in(&ac, data->data, data->data_len,
- data->flags & CEMU_DATA_F_TPDU_HDR);
+ rc = osmo_apdu_segment_in2(&ac, &prev_ac, data->data, data->data_len,
+ data->flags & CEMU_DATA_F_TPDU_HDR);
if (rc < 0) {
/* At this point the communication is broken. We cannot keep running, as we
* don't know if we should continue transmitting or receiving. Only a successful
--
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/43350?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Id5642cb76da4fcbcdd318d41691415781bf0bc50
Gerrit-Change-Number: 43350
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>