aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2019-07-03 23:30:24 +0200
committerMartin Kaiser <wireshark@kaiser.cx>2019-07-22 19:59:16 +0000
commit6fb78f3045e40147b6da749b75408c150faefaf8 (patch)
treea014620a4bf0378ac1e854607375c32b5285d194 /epan
parenta96d6c4ceafdf7c6c930e2fbefc8d0274348df27 (diff)
iso7816: link a transaction to a payload dissector
When an iso7816 request is forwarded to a payload dissector, store its handle in the transaction info. Call the new helper function to get the selected payload dissector's handle. Use the stored dissector handle to pass the response to the same payload dissector that handled the request. Change-Id: Idc6f7fbee978c095719aea937ab3179eac17f2a7 Reviewed-on: https://code.wireshark.org/review/33934 Petri-Dish: Martin Kaiser <wireshark@kaiser.cx> Tested-by: Petri Dish Buildbot Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-iso7816.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/epan/dissectors/packet-iso7816.c b/epan/dissectors/packet-iso7816.c
index db1cd27d28..667972bb06 100644
--- a/epan/dissectors/packet-iso7816.c
+++ b/epan/dissectors/packet-iso7816.c
@@ -101,6 +101,7 @@ typedef struct _iso7816_transaction_t {
the response contains no channel number to compare this to
and the spec explicitly prohibits interleaving of command-response
pairs, regardless of logical channels */
+ dissector_handle_t handle;
} iso7816_transaction_t;
static const value_string iso7816_atr_init_char[] = {
@@ -625,6 +626,7 @@ dissect_iso7816_cmd_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
iso7816_trans->cmd_frame = pinfo->num;
iso7816_trans->resp_frame = 0;
iso7816_trans->cmd_ins = INS_INVALID;
+ iso7816_trans->handle = NULL;
wmem_tree_insert32(transactions,
iso7816_trans->cmd_frame, (void *)iso7816_trans);
@@ -636,13 +638,15 @@ dissect_iso7816_cmd_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* the class byte says that the remaining APDU is not
in ISO7816 format */
- ret = dissector_try_payload_new(iso7816_apdu_pld_table,
- tvb, pinfo, tree, TRUE, NULL);
-
- if (ret == 0) {
- col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
- "Command APDU using proprietary format");
- return 1; /* we only dissected the class byte */
+ iso7816_trans->handle =
+ dissector_get_payload_handle(iso7816_apdu_pld_table);
+ if (iso7816_trans->handle != NULL) {
+ ret = call_dissector(iso7816_trans->handle, tvb, pinfo, tree);
+ if (ret == 0) {
+ col_append_sep_str(pinfo->cinfo, COL_INFO, NULL,
+ "Command APDU using proprietary format");
+ return 1; /* we only dissected the class byte */
+ }
}
return ret;
@@ -722,6 +726,9 @@ dissect_iso7816_resp_apdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
col_append_sep_fstr(pinfo->cinfo, COL_INFO, " ",
"(to %s)", cmd_ins_str);
}
+
+ if (iso7816_trans->handle != NULL)
+ call_dissector(iso7816_trans->handle, tvb, pinfo, tree);
}
}