diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2014-12-29 08:53:15 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2015-01-10 15:36:02 +0000 |
commit | 55df238efd77a3d1787a8adc1d5c81d05469bcc8 (patch) | |
tree | f08fe2c15cc2b6114c8eebf472cbd0b8c9a34d98 /epan/dissectors/packet-btsmp.c | |
parent | d6e040989280e9999ddbe0a2b41f9fd80c746dbd (diff) |
Bluetooth: SMP: Add missing opcode for "Identity Address Information"
Also fix tvb_length, tvb_length_remaining warnings.
Bug: 10299
Change-Id: Ib8b55ea9f2220394a5896d13e5cc4e2cefff1e13
Reviewed-on: https://code.wireshark.org/review/6407
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btsmp.c')
-rw-r--r-- | epan/dissectors/packet-btsmp.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/epan/dissectors/packet-btsmp.c b/epan/dissectors/packet-btsmp.c index 5ac91ac54f..d361272b05 100644 --- a/epan/dissectors/packet-btsmp.c +++ b/epan/dissectors/packet-btsmp.c @@ -29,6 +29,7 @@ #include "config.h" #include <epan/packet.h> +#include "packet-bluetooth.h" #include "packet-btl2cap.h" /* Initialize the protocol and registered fields */ @@ -53,6 +54,8 @@ static int hf_btsmp_ediv = -1; static int hf_btsmp_authreq = -1; static int hf_btsmp_initiator_key_distribution = -1; static int hf_btsmp_responder_key_distribution = -1; +static int hf_bd_addr = -1; +static int hf_address_type = -1; /* Initialize the subtree pointers */ static gint ett_btsmp = -1; @@ -202,7 +205,7 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U break; } - if (tvb_length_remaining(tvb, 0) < 1) + if (tvb_reported_length(tvb) < 1) return FALSE; proto_tree_add_item(st, hf_btsmp_opcode, tvb, 0, 1, ENC_LITTLE_ENDIAN); @@ -265,7 +268,14 @@ dissect_btsmp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U offset += 16; break; - case 0x0a: /* Signing Informationn */ + case 0x09: /* Identity Address Information */ + proto_tree_add_item(st, hf_address_type, tvb, offset, 1, ENC_NA); + offset += 1; + + offset = dissect_bd_addr(hf_bd_addr, st, tvb, offset, NULL); + break; + + case 0x0a: /* Signing Information */ proto_tree_add_item(st, hf_btsmp_signature_key, tvb, offset, 16, ENC_NA); offset += 16; break; @@ -380,6 +390,16 @@ proto_register_btsmp(void) {"Responder Key Distribution", "btsmp.responder_key_distribution", FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL} + }, + {&hf_bd_addr, + { "BD_ADDR", "btsmp.bd_addr", + FT_ETHER, BASE_NONE, NULL, 0x0, + "Bluetooth Device Address", HFILL} + }, + { &hf_address_type, + { "Address Type", "btsmp.address_type", + FT_UINT8, BASE_HEX, VALS(bluetooth_address_type_vals), 0x0, + NULL, HFILL } } }; |