lynxis lazus has submitted this change. (
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 TODO-RELEASE
M src/client/user_simtrace2.c
2 files changed, 4 insertions(+), 3 deletions(-)
Approvals:
lynxis lazus: Looks good to me, approved
laforge: Looks good to me, but someone else must approve
fixeria: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..1e46a1f 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public
release: c:r:0.
#library what description / commit summary line
+libosmo-simtrace2 >0.9.1 osmo-remsim-client-st2 uses new api
osmo_apdu_segment_in2()
diff --git a/src/client/user_simtrace2.c b/src/client/user_simtrace2.c
index 5d7d3c9..ad781ec 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: merged
Gerrit-Project: osmo-remsim
Gerrit-Branch: master
Gerrit-Change-Id: I432c96c8cdbcb78bc3e4f135ebd51c4077aa9007
Gerrit-Change-Number: 43351
Gerrit-PatchSet: 3
Gerrit-Owner: lynxis lazus <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <[email protected]>
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: lynxis lazus <[email protected]>