diff options
author | Martin Kaiser <wireshark@kaiser.cx> | 2019-05-24 10:45:07 +0200 |
---|---|---|
committer | Martin Kaiser <wireshark@kaiser.cx> | 2019-05-30 12:34:37 +0000 |
commit | d44cb24f1f6668db70baef59f81e7778f4230bf9 (patch) | |
tree | dbdc41035b091bbfcfcf6f4fac9d7a2ced758b2b | |
parent | 78a106dc2a5516b9b9cf42cf973d990828cac54e (diff) |
iso14443: use the correct I-block payload
When we reassemble I-blocks, we pass the payload to fragment_add_seq_next.
To do so, we use the overall iso14443 tvb, an offset and the payload length
as parameters.
We then call process_reassembled_data to do reassembly. If the I-block was
not fragmented, process_reassembled_data returns the only fragment + the
rest of the packet after this fragment.
This might be a misunderstanding on my part or something to be fixed in the
reassembly routines. For now, we work around this by defining a new tvb for
the data we submit to fragment_add_seq_next.
(I ran into a similar issue years ago for DVB-CI. Add a comment about this.
If it turns out that there's a better way to fix this, we should be fixing
both dissectors.)
Change-Id: Id83ab152529a5150669df3099df6f60be7a3a723
Reviewed-on: https://code.wireshark.org/review/33355
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Tested-by: Petri Dish Buildbot
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
-rw-r--r-- | epan/dissectors/packet-iso14443.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/epan/dissectors/packet-iso14443.c b/epan/dissectors/packet-iso14443.c index fc0154c210..56e402cef9 100644 --- a/epan/dissectors/packet-iso14443.c +++ b/epan/dissectors/packet-iso14443.c @@ -1071,9 +1071,6 @@ dissect_iso14443_cmd_type_block(tvbuff_t *tvb, packet_info *pinfo, } if (inf_len > 0) { - fragment_head *frag_msg; - tvbuff_t *payload_tvb; - inf_ti = proto_tree_add_item(tree, hf_iso14443_inf, tvb, offset, inf_len, ENC_NA); if (block_type == S_BLOCK_TYPE) { @@ -1089,10 +1086,16 @@ dissect_iso14443_cmd_type_block(tvbuff_t *tvb, packet_info *pinfo, } if (block_type == I_BLOCK_TYPE) { + fragment_head *frag_msg; + tvbuff_t *inf_tvb, *payload_tvb; + + /* see the comment in dissect_dvbci_tpdu (packet-dvbci.c) */ + inf_tvb = tvb_new_subset_length(tvb, offset, inf_len); frag_msg = fragment_add_seq_next(&i_block_reassembly_table, - tvb, offset, pinfo, 0, NULL, inf_len, (pcb & 0x10) ? 1 : 0); + inf_tvb, 0, pinfo, 0, NULL, inf_len, + (pcb & 0x10) ? 1 : 0); - payload_tvb = process_reassembled_data(tvb, offset, pinfo, + payload_tvb = process_reassembled_data(inf_tvb, 0, pinfo, "Reassembled APDU", frag_msg, &i_block_frag_items, NULL, tree); |