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 */