From f63fc333625480d241a1265992ab34b389dd9ed6 Mon Sep 17 00:00:00 2001 From: dsrsupport Date: Wed, 13 Sep 2017 16:18:05 +0300 Subject: ZigBee: implemented a dissector for ZBOSS key dump Implemented dissecting of ZBOSS keys dump (debug stuff) and adding a key into NWK keys ring. Move adding key to keyring from dissect_zbee_aps_transport_key into separate function. Change-Id: If0e414765350ec5131d0f815edf70cc224aef732 Reviewed-on: https://code.wireshark.org/review/23524 Reviewed-by: Michael Mann Petri-Dish: Michael Mann Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte --- epan/dissectors/packet-zbee-nwk.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'epan/dissectors/packet-zbee-nwk.c') diff --git a/epan/dissectors/packet-zbee-nwk.c b/epan/dissectors/packet-zbee-nwk.c index 593f7b8428..c159daf3f0 100644 --- a/epan/dissectors/packet-zbee-nwk.c +++ b/epan/dissectors/packet-zbee-nwk.c @@ -32,9 +32,11 @@ #include #include #include +#include /* for ws_ctz */ #include "packet-ieee802154.h" #include "packet-zbee.h" #include "packet-zbee-nwk.h" +#include "packet-zbee-aps.h" /* for ZBEE_APS_CMD_KEY_LENGTH */ #include "packet-zbee-security.h" #include @@ -150,6 +152,7 @@ static int hf_zbee_nwk_cmd_update_type = -1; static int hf_zbee_nwk_cmd_update_count = -1; static int hf_zbee_nwk_cmd_update_id = -1; static int hf_zbee_nwk_panid = -1; +static int hf_zbee_zboss_nwk_cmd_key = -1; static int hf_zbee_nwk_cmd_epid = -1; static int hf_zbee_nwk_cmd_end_device_timeout_request_enum = -1; static int hf_zbee_nwk_cmd_end_device_configuration = -1; @@ -269,6 +272,7 @@ static const value_string zbee_nwk_rejoin_codes[] = { /* Network Report Types */ static const value_string zbee_nwk_report_types[] = { { ZBEE_NWK_CMD_NWK_REPORT_ID_PAN_CONFLICT, "PAN Identifier Conflict" }, + { ZBEE_NWK_CMD_NWK_REPORT_ID_ZBOSS_KEY_TRACE, "ZBOSS key trace" }, { 0, NULL } }; @@ -1369,6 +1373,7 @@ dissect_zbee_nwk_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui proto_tree_add_uint(tree, hf_zbee_nwk_cmd_report_type, tvb, offset, 1, report_type); proto_tree_add_uint(tree, hf_zbee_nwk_cmd_report_count, tvb, offset, 1, report_count); offset += 1; + report_type >>= ws_ctz(ZBEE_NWK_CMD_NWK_REPORT_ID_MASK); /* Get and display the epid. */ proto_tree_add_item(tree, hf_zbee_nwk_cmd_epid, tvb, offset, 8, ENC_LITTLE_ENDIAN); @@ -1382,6 +1387,16 @@ dissect_zbee_nwk_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, gui offset += 2; } /* for */ } + if (report_type == ZBEE_NWK_CMD_NWK_REPORT_ID_ZBOSS_KEY_TRACE) { + guint8 key[ZBEE_APS_CMD_KEY_LENGTH]; + + for (i=0; icinfo, COL_INFO, ", %s", val_to_str_const(report_type, zbee_nwk_report_types, "Unknown Report Type")); @@ -2045,6 +2060,10 @@ void proto_register_zbee_nwk(void) { "PAN ID", "zbee_nwk.panid", FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }}, + { &hf_zbee_zboss_nwk_cmd_key, + { "ZBOSS Key", "zbee_nwk.zboss_key", FT_BYTES, BASE_NONE, NULL, 0x0, + NULL, HFILL }}, + { &hf_zbee_nwk_cmd_epid, { "Extended PAN ID", "zbee_nwk.cmd.epid", FT_EUI64, BASE_NONE, NULL, 0x0, NULL, HFILL }}, -- cgit v1.2.3