aboutsummaryrefslogtreecommitdiffstats
path: root/host
diff options
context:
space:
mode:
authorKévin Redon <kredon@sysmocom.de>2018-07-29 09:50:57 +0200
committerKévin Redon <kredon@sysmocom.de>2018-07-30 15:03:55 +0200
commit8f70c3eb1fe47fef6c9ac7ee769043b1664da3a4 (patch)
tree4b2f08abacd1207b7bda71746cbe16197d282c5e /host
parentebe672e92666f3e05cb7dacb04868fe168a19889 (diff)
remsim: fix payload overwriting
The slot number is in the header, and correctly set in st_push_hdr. Setting the slot in st_slot_tx_msg will overwrite the payload data. This caused bytes three of the ATR to be changed from 0x96 to 0x00, corrupting the ATR. This corruption is caught by the ATR checksum, and the modem would reset the card (2 additional times) to try to get correct ATR. Change-Id: If971699993617fc50557d20582c344ea06645a3f
Diffstat (limited to 'host')
-rw-r--r--host/simtrace2-remsim.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/host/simtrace2-remsim.c b/host/simtrace2-remsim.c
index 462f73e..52c5051 100644
--- a/host/simtrace2-remsim.c
+++ b/host/simtrace2-remsim.c
@@ -173,16 +173,11 @@ static struct simtrace_msg_hdr *st_push_hdr(struct msgb *msg, uint8_t msg_class,
int st_slot_tx_msg(struct st_slot *slot, struct msgb *msg,
uint8_t msg_class, uint8_t msg_type)
{
- struct simtrace_msg_hdr *sh = (struct simtrace_msg_hdr *) msg->data;
-
- sh->slot_nr = slot->slot_nr;
-
st_push_hdr(msg, msg_class, msg_type, slot->slot_nr);
return st_transp_tx_msg(slot->transp, msg);
}
-
/***********************************************************************
* Card Emulation protocol
***********************************************************************/