mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
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
This commit is contained in:
@@ -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
|
||||
***********************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user