aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2016-10-26 14:56:30 +0200
committerMichael Mann <mmann78@netscape.net>2016-12-05 14:01:13 +0000
commit4d9eb4caab3be28864dc2b257e5d6f5ffe6c48dc (patch)
tree1d2fa212422108d8f9efb7930862e5b8f1fdb1d7 /epan
parent2452367d25e39840f679538cd2e49649c914016e (diff)
Bluetooth: SMP: Dissect remaining AuthReq bits
Dissect SC, Keypress and Reserved bits. Up to Bluetooth Core 4 specification. Change-Id: Id7ac75bd917786abe9aada433a1343887a32234d Reviewed-on: https://code.wireshark.org/review/19079 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-btsmp.c55
1 files changed, 43 insertions, 12 deletions
diff --git a/epan/dissectors/packet-btsmp.c b/epan/dissectors/packet-btsmp.c
index 441788c0dc..d17b87982b 100644
--- a/epan/dissectors/packet-btsmp.c
+++ b/epan/dissectors/packet-btsmp.c
@@ -46,7 +46,9 @@ static int hf_btsmp_id_resolving_key = -1;
static int hf_btsmp_signature_key = -1;
static int hf_btsmp_bonding_flags = -1;
static int hf_btsmp_mitm_flag = -1;
-static int hf_btsmp_sc_flag = -1;
+static int hf_btsmp_secure_connection_flag = -1;
+static int hf_btsmp_keypress_flag = -1;
+static int hf_btsmp_reserved_flag = -1;
static int hf_btsmp_max_enc_key_size = -1;
static int hf_btsmp_key_dist_enc = -1;
static int hf_btsmp_key_dist_id = -1;
@@ -149,19 +151,38 @@ dissect_btsmp_auth_req(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree
proto_item *ti_param;
proto_tree *st_param;
guint8 param;
+ const guint8 *ph;
param = tvb_get_guint8(tvb, offset);
+
ti_param = proto_tree_add_item(tree, hf_btsmp_authreq, tvb, offset, 1, ENC_NA);
st_param = proto_item_add_subtree(ti_param, ett_btsmp_auth_req);
+
proto_tree_add_item(st_param, hf_btsmp_bonding_flags, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- proto_item_append_text(ti_param, "%s, ", val_to_str_const(param & 0x03, bonding_flag_vals, "<unknown>"));
- proto_tree_add_item(st_param, hf_btsmp_mitm_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- proto_item_append_text(ti_param, "%s, ", (param & 0x04) ? "MITM" : "No MITM");
- proto_tree_add_item(st_param, hf_btsmp_sc_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
- proto_item_append_text(ti_param, "%s", (param & 0x08) ? "SC" : "No SC");
+ ph = val_to_str_const(param & 0x03, bonding_flag_vals, "<unknown>");
+ proto_item_append_text(ti_param, ": %s, ", ph);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s, ", ph);
- col_append_fstr(pinfo->cinfo, COL_INFO, "%s, %s, %s", val_to_str_const(param & 0x03, bonding_flag_vals, "<unknown>"),
- (param & 0x04) ? "MITM" : "No MITM", (param & 0x08) ? "SC" : "No SC");
+ proto_tree_add_item(st_param, hf_btsmp_mitm_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ ph = (param & 0x04) ? "MITM" : "No MITM";
+ proto_item_append_text(ti_param, "%s, ", ph);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s, ", ph);
+
+ proto_tree_add_item(st_param, hf_btsmp_secure_connection_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ ph = (param & 0x08) ? "SecureConnection" : "No SC";
+ proto_item_append_text(ti_param, "%s, ", ph);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s, ", ph);
+
+ proto_tree_add_item(st_param, hf_btsmp_keypress_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ ph = (param & 0x10) ? "Keypress" : "No Keypress";
+ proto_item_append_text(ti_param, "%s", ph);
+ col_append_fstr(pinfo->cinfo, COL_INFO, "%s", ph);
+
+ proto_tree_add_item(st_param, hf_btsmp_reserved_flag, tvb, offset, 1, ENC_LITTLE_ENDIAN);
+ if (param & 0xE0) {
+ proto_item_append_text(ti_param, ", Reserved");
+ col_append_fstr(pinfo->cinfo, COL_INFO, ", Reserved");
+ }
return offset + 1;
}
@@ -406,12 +427,22 @@ proto_register_btsmp(void)
},
{&hf_btsmp_mitm_flag,
{"MITM Flag", "btsmp.mitm_flag",
- FT_UINT8, BASE_DEC, NULL, 0x04,
+ FT_BOOLEAN, 8, NULL, 0x04,
+ NULL, HFILL}
+ },
+ {&hf_btsmp_secure_connection_flag,
+ {"Secure Connection Flag", "btsmp.sc_flag",
+ FT_BOOLEAN, 8, NULL, 0x08,
+ NULL, HFILL}
+ },
+ {&hf_btsmp_keypress_flag,
+ {"Keypress Flag", "btsmp.keypress_flag",
+ FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL}
},
- {&hf_btsmp_sc_flag,
- {"SC Flag", "btsmp.sc_flag",
- FT_UINT8, BASE_DEC, NULL, 0x08,
+ {&hf_btsmp_reserved_flag,
+ {"Reserved", "btsmp.reserved_flags",
+ FT_UINT8, BASE_HEX, NULL, 0xE0,
NULL, HFILL}
},
{&hf_btsmp_max_enc_key_size,