summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bpsec.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-bpsec.c')
-rw-r--r--epan/dissectors/packet-bpsec.c240
1 files changed, 119 insertions, 121 deletions
diff --git a/epan/dissectors/packet-bpsec.c b/epan/dissectors/packet-bpsec.c
index 94f64327..4e63dd9b 100644
--- a/epan/dissectors/packet-bpsec.c
+++ b/epan/dissectors/packet-bpsec.c
@@ -13,6 +13,7 @@
* SPDX-License-Identifier: LGPL-2.1-or-later
*/
#include "config.h"
+#include <stdint.h>
#include "packet-bpsec.h"
#include "packet-bpv7.h"
@@ -20,10 +21,7 @@
#include <epan/prefs.h>
#include <epan/proto.h>
#include <epan/expert.h>
-#include <epan/to_str.h>
-#include <wsutil/crc16.h>
-#include <wsutil/crc32.h>
-#include <inttypes.h>
+#include <epan/tfs.h>
#include "epan/wscbor.h"
void proto_register_bpsec(void);
@@ -33,13 +31,13 @@ void proto_reg_handoff_bpsec(void);
//static const char *LOG_DOMAIN = "bpsec";
/// Protocol handles
-static int proto_bpsec = -1;
+static int proto_bpsec;
/// Dissect opaque CBOR data
-static dissector_handle_t handle_cbor = NULL;
+static dissector_handle_t handle_cbor;
/// Extension sub-dissectors
-static dissector_table_t param_dissectors = NULL;
-static dissector_table_t result_dissectors = NULL;
+static dissector_table_t param_dissectors;
+static dissector_table_t result_dissectors;
static const val64_string shavar_vals[] = {
{5, "HMAC 256/256"},
@@ -54,34 +52,34 @@ static const val64_string aesvar_vals[] = {
{0, NULL},
};
-static int hf_bib = -1;
-static int hf_bcb = -1;
-static int hf_asb_target_list = -1;
-static int hf_asb_target = -1;
-static int hf_asb_ctxid = -1;
-static int hf_asb_flags = -1;
-static int hf_asb_flags_has_params = -1;
-static int hf_asb_secsrc_nodeid = -1;
-static int hf_asb_secsrc_uri = -1;
-static int hf_asb_param_list = -1;
-static int hf_asb_param_pair = -1;
-static int hf_asb_param_id = -1;
-static int hf_asb_result_all_list = -1;
-static int hf_asb_result_tgt_list = -1;
-static int hf_asb_result_tgt_ref = -1;
-static int hf_asb_result_pair = -1;
-static int hf_asb_result_id = -1;
-
-static int hf_defaultsc_shavar = -1;
-static int hf_defaultsc_wrapedkey = -1;
-static int hf_defaultsc_scope = -1;
-static int hf_defaultsc_scope_pri_block = -1;
-static int hf_defaultsc_scope_tgt_head = -1;
-static int hf_defaultsc_scope_sec_head = -1;
-static int hf_defaultsc_hmac = -1;
-static int hf_defaultsc_iv = -1;
-static int hf_defaultsc_aesvar = -1;
-static int hf_defaultsc_authtag = -1;
+static int hf_bib;
+static int hf_bcb;
+static int hf_asb_target_list;
+static int hf_asb_target;
+static int hf_asb_ctxid;
+static int hf_asb_flags;
+static int hf_asb_flags_has_params;
+static int hf_asb_secsrc_nodeid;
+static int hf_asb_secsrc_uri;
+static int hf_asb_param_list;
+static int hf_asb_param_pair;
+static int hf_asb_param_id;
+static int hf_asb_result_all_list;
+static int hf_asb_result_tgt_list;
+static int hf_asb_result_tgt_ref;
+static int hf_asb_result_pair;
+static int hf_asb_result_id;
+
+static int hf_defaultsc_shavar;
+static int hf_defaultsc_wrapedkey;
+static int hf_defaultsc_scope;
+static int hf_defaultsc_scope_pri_block;
+static int hf_defaultsc_scope_tgt_head;
+static int hf_defaultsc_scope_sec_head;
+static int hf_defaultsc_hmac;
+static int hf_defaultsc_iv;
+static int hf_defaultsc_aesvar;
+static int hf_defaultsc_authtag;
/// Field definitions
static hf_register_info fields[] = {
@@ -127,15 +125,15 @@ static int *const defaultsc_scope[] = {
NULL
};
-static int ett_asb = -1;
-static int ett_asb_flags = -1;
-static int ett_tgt_list = -1;
-static int ett_param_list = -1;
-static int ett_param_pair = -1;
-static int ett_result_all_list = -1;
-static int ett_result_tgt_list = -1;
-static int ett_result_pair = -1;
-static int ett_defaultsc_scope = -1;
+static int ett_asb;
+static int ett_asb_flags;
+static int ett_tgt_list;
+static int ett_param_list;
+static int ett_param_pair;
+static int ett_result_all_list;
+static int ett_result_tgt_list;
+static int ett_result_pair;
+static int ett_defaultsc_scope;
/// Tree structures
static int *ett[] = {
&ett_asb,
@@ -149,11 +147,11 @@ static int *ett[] = {
&ett_defaultsc_scope,
};
-static expert_field ei_secsrc_diff = EI_INIT;
-static expert_field ei_ctxid_zero = EI_INIT;
-static expert_field ei_ctxid_priv = EI_INIT;
-static expert_field ei_target_invalid = EI_INIT;
-static expert_field ei_value_partial_decode = EI_INIT;
+static expert_field ei_secsrc_diff;
+static expert_field ei_ctxid_zero;
+static expert_field ei_ctxid_priv;
+static expert_field ei_target_invalid;
+static expert_field ei_value_partial_decode;
static ei_register_info expertitems[] = {
{&ei_secsrc_diff, {"bpsec.secsrc_diff", PI_SECURITY, PI_CHAT, "BPSec Security Source different from bundle Source", EXPFILL}},
{&ei_ctxid_zero, {"bpsec.ctxid_zero", PI_SECURITY, PI_WARN, "BPSec Security Context ID zero is reserved", EXPFILL}},
@@ -162,7 +160,7 @@ static ei_register_info expertitems[] = {
{&ei_value_partial_decode, {"bpsec.value_partial_decode", PI_UNDECODED, PI_WARN, "Value data not fully dissected", EXPFILL}},
};
-bpsec_id_t * bpsec_id_new(wmem_allocator_t *alloc, gint64 context_id, gint64 type_id) {
+bpsec_id_t * bpsec_id_new(wmem_allocator_t *alloc, int64_t context_id, int64_t type_id) {
bpsec_id_t *obj;
if (alloc) {
obj = wmem_new(alloc, bpsec_id_t);
@@ -175,12 +173,12 @@ bpsec_id_t * bpsec_id_new(wmem_allocator_t *alloc, gint64 context_id, gint64 typ
return obj;
}
-void bpsec_id_free(wmem_allocator_t *alloc, gpointer ptr) {
+void bpsec_id_free(wmem_allocator_t *alloc, void *ptr) {
//bpsec_id_t *obj = (bpsec_id_t *)ptr;
wmem_free(alloc, ptr);
}
-gboolean bpsec_id_equal(gconstpointer a, gconstpointer b) {
+gboolean bpsec_id_equal(const void *a, const void *b) {
const bpsec_id_t *aobj = a;
const bpsec_id_t *bobj = b;
return (
@@ -190,7 +188,7 @@ gboolean bpsec_id_equal(gconstpointer a, gconstpointer b) {
);
}
-guint bpsec_id_hash(gconstpointer key) {
+unsigned bpsec_id_hash(const void *key) {
const bpsec_id_t *obj = key;
return (
g_int64_hash(&(obj->context_id))
@@ -201,11 +199,11 @@ guint bpsec_id_hash(gconstpointer key) {
/** Dissect an ID-value pair within a context.
*
*/
-static gint dissect_value(dissector_handle_t dissector, gint64 *typeid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
- gint sublen = 0;
+static int dissect_value(dissector_handle_t dissector, int64_t *typeid, tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) {
+ int sublen = 0;
if (dissector) {
sublen = call_dissector_with_data(dissector, tvb, pinfo, tree, typeid);
- if ((sublen < 0) || ((guint)sublen < tvb_captured_length(tvb))) {
+ if ((sublen < 0) || ((unsigned)sublen < tvb_captured_length(tvb))) {
expert_add_info(pinfo, proto_tree_get_parent(tree), &ei_value_partial_decode);
}
}
@@ -220,21 +218,21 @@ static gint dissect_value(dissector_handle_t dissector, gint64 *typeid, tvbuff_t
static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, const bp_dissector_data_t *const data, int root_hfindex) {
proto_item *item_asb = proto_tree_add_item(tree, root_hfindex, tvb, 0, -1, ENC_NA);
proto_tree *tree_asb = proto_item_add_subtree(item_asb, ett_asb);
- gint offset = 0;
+ int offset = 0;
wmem_array_t *targets;
- targets = wmem_array_new(wmem_packet_scope(), sizeof(guint64));
+ targets = wmem_array_new(pinfo->pool, sizeof(uint64_t));
- wscbor_chunk_t *chunk_tgt_list = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ wscbor_chunk_t *chunk_tgt_list = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array(chunk_tgt_list);
proto_item *item_tgt_list = proto_tree_add_cbor_container(tree_asb, hf_asb_target_list, pinfo, tvb, chunk_tgt_list);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_tgt_list)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_tgt_list)) {
proto_tree *tree_tgt_list = proto_item_add_subtree(item_tgt_list, ett_tgt_list);
// iterate all targets
- for (guint64 param_ix = 0; param_ix < chunk_tgt_list->head_value; ++param_ix) {
- wscbor_chunk_t *chunk_tgt = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- guint64 *tgt_blknum = wscbor_require_uint64(wmem_packet_scope(), chunk_tgt);
+ for (uint64_t param_ix = 0; param_ix < chunk_tgt_list->head_value; ++param_ix) {
+ wscbor_chunk_t *chunk_tgt = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ uint64_t *tgt_blknum = wscbor_require_uint64(pinfo->pool, chunk_tgt);
proto_item *item_tgt = proto_tree_add_cbor_uint64(tree_tgt_list, hf_asb_target, pinfo, tvb, chunk_tgt, tgt_blknum);
if (tgt_blknum) {
wmem_array_append(targets, tgt_blknum, 1);
@@ -269,8 +267,8 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
proto_item_set_len(item_tgt_list, offset - chunk_tgt_list->start);
}
- wscbor_chunk_t *chunk_ctxid = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- gint64 *ctxid = wscbor_require_int64(wmem_packet_scope(), chunk_ctxid);
+ wscbor_chunk_t *chunk_ctxid = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ int64_t *ctxid = wscbor_require_int64(pinfo->pool, chunk_ctxid);
proto_item *item_ctxid = proto_tree_add_cbor_int64(tree_asb, hf_asb_ctxid, pinfo, tvb, chunk_ctxid, ctxid);
if (ctxid) {
if (*ctxid == 0) {
@@ -281,12 +279,12 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
}
- wscbor_chunk_t *chunk_flags = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- guint64 *flags = wscbor_require_uint64(wmem_packet_scope(), chunk_flags);
+ wscbor_chunk_t *chunk_flags = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ uint64_t *flags = wscbor_require_uint64(pinfo->pool, chunk_flags);
proto_tree_add_cbor_bitmask(tree_asb, hf_asb_flags, ett_asb_flags, asb_flags, pinfo, tvb, chunk_flags, flags);
{
- bp_eid_t *secsrc = bp_eid_new(wmem_packet_scope());
+ bp_eid_t *secsrc = bp_eid_new(pinfo->pool);
proto_item *item_secsrc = proto_tree_add_cbor_eid(tree_asb, hf_asb_secsrc_nodeid, hf_asb_secsrc_uri, pinfo, tvb, &offset, secsrc);
if (!bp_eid_equal(data->bundle->primary->src_nodeid, secsrc)) {
expert_add_info(pinfo, item_secsrc, &ei_secsrc_diff);
@@ -294,38 +292,38 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
if (flags && (*flags & BPSEC_ASB_HAS_PARAMS)) {
- wscbor_chunk_t *chunk_param_list = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ wscbor_chunk_t *chunk_param_list = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array(chunk_param_list);
proto_item *item_param_list = proto_tree_add_cbor_container(tree_asb, hf_asb_param_list, pinfo, tvb, chunk_param_list);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_param_list)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_param_list)) {
proto_tree *tree_param_list = proto_item_add_subtree(item_param_list, ett_param_list);
// iterate all parameters
- for (guint64 param_ix = 0; param_ix < chunk_param_list->head_value; ++param_ix) {
- wscbor_chunk_t *chunk_param_pair = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ for (uint64_t param_ix = 0; param_ix < chunk_param_list->head_value; ++param_ix) {
+ wscbor_chunk_t *chunk_param_pair = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array_size(chunk_param_pair, 2, 2);
proto_item *item_param_pair = proto_tree_add_cbor_container(tree_param_list, hf_asb_param_pair, pinfo, tvb, chunk_param_pair);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_param_pair)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_param_pair)) {
proto_tree *tree_param_pair = proto_item_add_subtree(item_param_pair, ett_param_pair);
- wscbor_chunk_t *chunk_paramid = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- gint64 *paramid = wscbor_require_int64(wmem_packet_scope(), chunk_paramid);
+ wscbor_chunk_t *chunk_paramid = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ int64_t *paramid = wscbor_require_int64(pinfo->pool, chunk_paramid);
proto_tree_add_cbor_int64(tree_param_pair, hf_asb_param_id, pinfo, tvb, chunk_paramid, paramid);
if (paramid) {
proto_item_append_text(item_param_pair, ", ID: %" PRId64, *paramid);
}
- const gint offset_value = offset;
- if (!wscbor_skip_next_item(wmem_packet_scope(), tvb, &offset)) {
+ const int offset_value = offset;
+ if (!wscbor_skip_next_item(pinfo->pool, tvb, &offset)) {
return 0;
}
tvbuff_t *tvb_value = tvb_new_subset_length(tvb, offset_value, offset - offset_value);
dissector_handle_t value_dissect = NULL;
if (ctxid && paramid) {
- bpsec_id_t *key = bpsec_id_new(wmem_packet_scope(), *ctxid, *paramid);
+ bpsec_id_t *key = bpsec_id_new(pinfo->pool, *ctxid, *paramid);
value_dissect = dissector_get_custom_table_handle(param_dissectors, key);
- bpsec_id_free(wmem_packet_scope(), key);
+ bpsec_id_free(pinfo->pool, key);
}
dissect_value(value_dissect, paramid, tvb_value, pinfo, tree_param_pair);
@@ -338,55 +336,55 @@ static int dissect_block_asb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
// array sizes should agree
- const guint tgt_size = wmem_array_get_count(targets);
+ const unsigned tgt_size = wmem_array_get_count(targets);
- wscbor_chunk_t *chunk_result_all_list = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ wscbor_chunk_t *chunk_result_all_list = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array_size(chunk_result_all_list, tgt_size, tgt_size);
proto_item *item_result_all_list = proto_tree_add_cbor_container(tree_asb, hf_asb_result_all_list, pinfo, tvb, chunk_result_all_list);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_result_all_list)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_result_all_list)) {
proto_tree *tree_result_all_list = proto_item_add_subtree(item_result_all_list, ett_result_all_list);
// iterate each target's results
- for (guint tgt_ix = 0; tgt_ix < tgt_size; ++tgt_ix) {
- wscbor_chunk_t *chunk_result_tgt_list = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ for (unsigned tgt_ix = 0; tgt_ix < tgt_size; ++tgt_ix) {
+ wscbor_chunk_t *chunk_result_tgt_list = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array(chunk_result_tgt_list);
proto_item *item_result_tgt_list = proto_tree_add_cbor_container(tree_result_all_list, hf_asb_result_tgt_list, pinfo, tvb, chunk_result_tgt_list);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_result_tgt_list)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_result_tgt_list)) {
proto_tree *tree_result_tgt_list = proto_item_add_subtree(item_result_tgt_list, ett_result_tgt_list);
// Hint at the associated target number
if (tgt_ix < tgt_size) {
- const guint64 *tgt_blknum = wmem_array_index(targets, tgt_ix);
+ const uint64_t *tgt_blknum = wmem_array_index(targets, tgt_ix);
proto_item *item_tgt_blknum = proto_tree_add_uint64(tree_result_tgt_list, hf_asb_result_tgt_ref, tvb, 0, 0, *tgt_blknum);
proto_item_set_generated(item_tgt_blknum);
}
// iterate all results for this target
- for (guint64 result_ix = 0; result_ix < chunk_result_tgt_list->head_value; ++result_ix) {
- wscbor_chunk_t *chunk_result_pair = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
+ for (uint64_t result_ix = 0; result_ix < chunk_result_tgt_list->head_value; ++result_ix) {
+ wscbor_chunk_t *chunk_result_pair = wscbor_chunk_read(pinfo->pool, tvb, &offset);
wscbor_require_array_size(chunk_result_pair, 2, 2);
proto_item *item_result_pair = proto_tree_add_cbor_container(tree_result_tgt_list, hf_asb_result_pair, pinfo, tvb, chunk_result_pair);
- if (!wscbor_skip_if_errors(wmem_packet_scope(), tvb, &offset, chunk_result_pair)) {
+ if (!wscbor_skip_if_errors(pinfo->pool, tvb, &offset, chunk_result_pair)) {
proto_tree *tree_result_pair = proto_item_add_subtree(item_result_pair, ett_result_pair);
- wscbor_chunk_t *chunk_resultid = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- gint64 *resultid = wscbor_require_int64(wmem_packet_scope(), chunk_resultid);
+ wscbor_chunk_t *chunk_resultid = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ int64_t *resultid = wscbor_require_int64(pinfo->pool, chunk_resultid);
proto_tree_add_cbor_int64(tree_result_pair, hf_asb_result_id, pinfo, tvb, chunk_resultid, resultid);
if (resultid) {
proto_item_append_text(item_result_pair, ", ID: %" PRId64, *resultid);
}
- const gint offset_value = offset;
- if (!wscbor_skip_next_item(wmem_packet_scope(), tvb, &offset)) {
+ const int offset_value = offset;
+ if (!wscbor_skip_next_item(pinfo->pool, tvb, &offset)) {
return 0;
}
tvbuff_t *tvb_value = tvb_new_subset_length(tvb, offset_value, offset - offset_value);
dissector_handle_t value_dissect = NULL;
if (ctxid && resultid) {
- bpsec_id_t *key = bpsec_id_new(wmem_packet_scope(), *ctxid, *resultid);
+ bpsec_id_t *key = bpsec_id_new(pinfo->pool, *ctxid, *resultid);
value_dissect = dissector_get_custom_table_handle(result_dissectors, key);
- bpsec_id_free(wmem_packet_scope(), key);
+ bpsec_id_free(pinfo->pool, key);
}
dissect_value(value_dissect, resultid, tvb_value, pinfo, tree_result_pair);
@@ -418,57 +416,57 @@ static int dissect_block_bcb(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree
}
static int dissect_defaultsc_param_shavar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- guint64 *val = wscbor_require_uint64(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ uint64_t *val = wscbor_require_uint64(pinfo->pool, chunk);
proto_tree_add_cbor_uint64(tree, hf_defaultsc_shavar, pinfo, tvb, chunk, val);
return offset;
}
static int dissect_defaultsc_param_wrappedkey(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- wscbor_require_bstr(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ wscbor_require_bstr(pinfo->pool, chunk);
proto_tree_add_cbor_bstr(tree, hf_defaultsc_wrapedkey, pinfo, tvb, chunk);
return offset;
}
static int dissect_defaultsc_param_scope(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- guint64 *flags = wscbor_require_uint64(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ uint64_t *flags = wscbor_require_uint64(pinfo->pool, chunk);
proto_tree_add_cbor_bitmask(tree, hf_defaultsc_scope, ett_defaultsc_scope, defaultsc_scope, pinfo, tvb, chunk, flags);
return offset;
}
static int dissect_defaultsc_result_hmac(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- wscbor_require_bstr(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ wscbor_require_bstr(pinfo->pool, chunk);
proto_tree_add_cbor_bstr(tree, hf_defaultsc_hmac, pinfo, tvb, chunk);
return offset;
}
static int dissect_defaultsc_param_iv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- wscbor_require_bstr(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ wscbor_require_bstr(pinfo->pool, chunk);
proto_tree_add_cbor_bstr(tree, hf_defaultsc_iv, pinfo, tvb, chunk);
return offset;
}
static int dissect_defaultsc_param_aesvar(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- guint64 *val = wscbor_require_uint64(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ uint64_t *val = wscbor_require_uint64(pinfo->pool, chunk);
proto_tree_add_cbor_uint64(tree, hf_defaultsc_aesvar, pinfo, tvb, chunk, val);
return offset;
}
static int dissect_defaultsc_result_authtag(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
- gint offset = 0;
- wscbor_chunk_t *chunk = wscbor_chunk_read(wmem_packet_scope(), tvb, &offset);
- wscbor_require_bstr(wmem_packet_scope(), chunk);
+ int offset = 0;
+ wscbor_chunk_t *chunk = wscbor_chunk_read(pinfo->pool, tvb, &offset);
+ wscbor_require_bstr(pinfo->pool, chunk);
proto_tree_add_cbor_bstr(tree, hf_defaultsc_authtag, pinfo, tvb, chunk);
return offset;
}
@@ -497,15 +495,15 @@ void proto_reg_handoff_bpsec(void) {
/* Packaged extensions */
{
- guint64 *key = g_new(guint64, 1);
+ uint64_t *key = g_new(uint64_t, 1);
*key = BP_BLOCKTYPE_BIB;
- dissector_handle_t hdl = create_dissector_handle_with_name(dissect_block_bib, proto_bpsec, "Block Integrity Block");
+ dissector_handle_t hdl = create_dissector_handle_with_name_and_description(dissect_block_bib, proto_bpsec, NULL, "Block Integrity Block");
dissector_add_custom_table_handle("bpv7.block_type", key, hdl);
}
{
- guint64 *key = g_new(guint64, 1);
+ uint64_t *key = g_new(uint64_t, 1);
*key = BP_BLOCKTYPE_BCB;
- dissector_handle_t hdl = create_dissector_handle_with_name(dissect_block_bcb, proto_bpsec, "Block Confidentiality Block");
+ dissector_handle_t hdl = create_dissector_handle_with_name_and_description(dissect_block_bcb, proto_bpsec, NULL, "Block Confidentiality Block");
dissector_add_custom_table_handle("bpv7.block_type", key, hdl);
}