aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-mka.c
diff options
context:
space:
mode:
Diffstat (limited to 'epan/dissectors/packet-mka.c')
-rw-r--r--epan/dissectors/packet-mka.c511
1 files changed, 405 insertions, 106 deletions
diff --git a/epan/dissectors/packet-mka.c b/epan/dissectors/packet-mka.c
index 3010c58935..24866d035b 100644
--- a/epan/dissectors/packet-mka.c
+++ b/epan/dissectors/packet-mka.c
@@ -14,6 +14,7 @@
#include <epan/packet.h>
#include <epan/expert.h>
+#include <epan/uat.h>
#include "packet-eapol.h"
@@ -30,85 +31,94 @@
void proto_register_mka(void);
void proto_reg_handoff_mka(void);
-static int proto_mka = -1;
-
-static int hf_mka_version_id = -1;
-static int hf_mka_basic_param_set = -1;
-static int hf_mka_live_peer_list_set = -1;
-static int hf_mka_potential_peer_list_set = -1;
-static int hf_mka_macsec_sak_use_set = -1;
-static int hf_mka_distributed_sak_set = -1;
-static int hf_mka_distributed_cak_set = -1;
-static int hf_mka_kmd_set = -1;
-static int hf_mka_announcement_set = -1;
-static int hf_mka_xpn_set = -1;
-static int hf_mka_icv_set = -1;
-static int hf_mka_param_set_type = -1;
-
-static int hf_mka_keyserver_priority = -1;
-static int hf_mka_key_server = -1;
-static int hf_mka_macsec_desired = -1;
-static int hf_mka_macsec_capability = -1;
-static int hf_mka_param_body_length = -1;
-static int hf_mka_sci = -1;
-static int hf_mka_actor_mi = -1;
-static int hf_mka_actor_mn = -1;
-static int hf_mka_algo_agility = -1;
-static int hf_mka_cak_name = -1;
-
-static int hf_mka_padding = -1;
-
-static int hf_mka_key_server_ssci = -1;
-static int hf_mka_peer_mi = -1;
-static int hf_mka_peer_mn = -1;
-
-static int hf_mka_latest_key_an = -1;
-static int hf_mka_latest_key_tx = -1;
-static int hf_mka_latest_key_rx = -1;
-static int hf_mka_old_key_an = -1;
-static int hf_mka_old_key_tx = -1;
-static int hf_mka_old_key_rx = -1;
-static int hf_mka_plain_tx = -1;
-static int hf_mka_plain_rx = -1;
-static int hf_mka_delay_protect = -1;
-static int hf_mka_latest_key_server_mi = -1;
-static int hf_mka_latest_key_number = -1;
-static int hf_mka_latest_lowest_acceptable_pn = -1;
-static int hf_mka_old_key_server_mi = -1;
-static int hf_mka_old_key_number = -1;
-static int hf_mka_old_lowest_acceptable_pn = -1;
-
-static int hf_mka_distributed_an = -1;
-static int hf_mka_confidentiality_offset = -1;
-static int hf_mka_key_number = -1;
-static int hf_mka_aes_key_wrap_sak = -1;
-static int hf_mka_macsec_cipher_suite = -1;
-static int hf_mka_aes_key_wrap_cak = -1;
-
-static int hf_mka_kmd = -1;
-
-static int hf_mka_suspension_time = -1;
-
-static int hf_mka_unknown_set = -1;
-static int hf_mka_unknown_param_set = -1;
-
-static int hf_mka_icv = -1;
-
-static expert_field ei_mka_undecoded = EI_INIT;
-static expert_field ei_unexpected_data = EI_INIT;
-static expert_field ei_mka_unimplemented = EI_INIT;
-
-static gint ett_mka = -1;
-static gint ett_mka_basic_param_set = -1;
-static gint ett_mka_peer_list_set = -1;
-static gint ett_mka_sak_use_set = -1;
-static gint ett_mka_distributed_sak_set = -1;
-static gint ett_mka_distributed_cak_set = -1;
-static gint ett_mka_kmd_set = -1;
-static gint ett_mka_announcement_set = -1;
-static gint ett_mka_xpn_set = -1;
-static gint ett_mka_unknown_set = -1;
-static gint ett_mka_icv_set = -1;
+static int proto_mka;
+
+static int hf_mka_version_id;
+static int hf_mka_basic_param_set;
+static int hf_mka_live_peer_list_set;
+static int hf_mka_potential_peer_list_set;
+static int hf_mka_macsec_sak_use_set;
+static int hf_mka_distributed_sak_set;
+static int hf_mka_distributed_cak_set;
+static int hf_mka_kmd_set;
+static int hf_mka_announcement_set;
+static int hf_mka_xpn_set;
+static int hf_mka_icv_set;
+static int hf_mka_param_set_type;
+
+static int hf_mka_keyserver_priority;
+static int hf_mka_key_server;
+static int hf_mka_macsec_desired;
+static int hf_mka_macsec_capability;
+static int hf_mka_param_body_length;
+static int hf_mka_sci;
+static int hf_mka_actor_mi;
+static int hf_mka_actor_mn;
+static int hf_mka_algo_agility;
+static int hf_mka_cak_name;
+static int hf_mka_cak_name_info;
+
+static int hf_mka_padding;
+
+static int hf_mka_key_server_ssci;
+static int hf_mka_peer_mi;
+static int hf_mka_peer_mn;
+
+static int hf_mka_latest_key_an;
+static int hf_mka_latest_key_tx;
+static int hf_mka_latest_key_rx;
+static int hf_mka_old_key_an;
+static int hf_mka_old_key_tx;
+static int hf_mka_old_key_rx;
+static int hf_mka_plain_tx;
+static int hf_mka_plain_rx;
+static int hf_mka_delay_protect;
+static int hf_mka_latest_key_server_mi;
+static int hf_mka_latest_key_number;
+static int hf_mka_latest_lowest_acceptable_pn;
+static int hf_mka_old_key_server_mi;
+static int hf_mka_old_key_number;
+static int hf_mka_old_lowest_acceptable_pn;
+
+static int hf_mka_distributed_an;
+static int hf_mka_confidentiality_offset;
+static int hf_mka_key_number;
+static int hf_mka_aes_key_wrap_sak;
+static int hf_mka_macsec_cipher_suite;
+static int hf_mka_aes_key_wrap_cak;
+
+static int hf_mka_kmd;
+
+static int hf_mka_suspension_time;
+
+static int hf_mka_unknown_set;
+static int hf_mka_unknown_param_set;
+
+static int hf_mka_icv;
+
+static int hf_mka_tlv_entry;
+static int hf_mka_tlv_type;
+static int hf_mka_tlv_info_string_length;
+static int hf_mka_tlv_data;
+static int hf_mka_tlv_cipher_suite_impl_cap;
+
+static expert_field ei_mka_undecoded;
+static expert_field ei_unexpected_data;
+static expert_field ei_mka_unimplemented;
+
+static gint ett_mka;
+static gint ett_mka_basic_param_set;
+static gint ett_mka_peer_list_set;
+static gint ett_mka_sak_use_set;
+static gint ett_mka_distributed_sak_set;
+static gint ett_mka_distributed_cak_set;
+static gint ett_mka_kmd_set;
+static gint ett_mka_announcement_set;
+static gint ett_mka_xpn_set;
+static gint ett_mka_unknown_set;
+static gint ett_mka_icv_set;
+static gint ett_mka_tlv;
+static gint ett_mka_cipher_suite_entry;
static const value_string param_set_type_vals[] = {
{ LIVE_PEER_LIST_TYPE, "Live Peer List" },
@@ -126,8 +136,8 @@ static const value_string param_set_type_vals[] = {
static const value_string macsec_capability_type_vals[] = {
{ 0, "MACsec not implemented" },
{ 1, "MACsec Integrity without confidentiality" },
- { 2, "MACsec Integrity with no confidentiality offset" },
- { 3, "MACsec Integrity with confidentiality offset" },
+ { 2, "MACsec Integrity with/without confidentiality, no confidentiality offset" },
+ { 3, "MACsec Integrity with/without confidentiality, confidentiality offset 0, 30, or 50" },
{ 0, NULL }
};
@@ -153,6 +163,154 @@ static const val64_string macsec_cipher_suite_vals[] = {
{ 0, NULL }
};
+
+static const value_string macsec_tlvs[] = {
+ // 0 - 110 reserved
+ { 111, "Access Information" },
+ { 112, "MACsec Cipher Suites" },
+ { 113, "Key Management Domain" },
+ { 114, "NID (Network Identifier)" },
+ // 115 - 125 reserved
+ { 126, "Organizationally Specific Set TLV" },
+ { 127, "Organizationally Specific TLVs" },
+ { 0, NULL }
+};
+
+
+/*** UAT: CKN INFO ***/
+
+#define DATAFILE_CKN_INFO "mka_ckn_info"
+
+typedef struct _mka_ckn_info_key {
+ /* CKN: a byte array of 0 to 32 bytes. */
+ guchar *ckn;
+ guint ckn_len;
+} mka_ckn_info_key_t;
+
+typedef struct _mka_ckn_info {
+ mka_ckn_info_key_t key;
+ gchar *name;
+} mka_ckn_info_t;
+
+static mka_ckn_info_t *mka_ckn_uat_data = NULL;
+static guint num_mka_ckn_uat_data = 0;
+static GHashTable *ht_mka_ckn = NULL;
+
+UAT_BUFFER_CB_DEF(mka_ckn_uat_data, ckn, mka_ckn_info_t, key.ckn, key.ckn_len)
+UAT_CSTRING_CB_DEF(mka_ckn_uat_data, name, mka_ckn_info_t)
+
+static guint
+ckn_key_hash_func(gconstpointer k) {
+ const mka_ckn_info_key_t *key = (const mka_ckn_info_key_t *)k;
+ size_t i;
+ guint hash = 0;
+ guint8 *tmp = (guint8 *)key->ckn;
+
+ /* Reduce to guint32 by XOR */
+ for (i = 0; i < key->ckn_len; i++) {
+ hash ^= tmp[i] << 8 * (i % 4);
+ }
+
+ return hash;
+}
+
+static gint
+ckn_key_equal_func(gconstpointer c1, gconstpointer c2) {
+ const mka_ckn_info_key_t *ckn1 = (const mka_ckn_info_key_t *)c1;
+ const mka_ckn_info_key_t *ckn2 = (const mka_ckn_info_key_t *)c2;
+ if (ckn1->ckn_len != ckn2->ckn_len) return 0;
+ if (memcmp(ckn1->ckn, ckn2->ckn, ckn1->ckn_len) != 0) return 0;
+
+ return 1;
+}
+
+static void *
+ckn_info_copy_cb(void *n, const void *o, size_t size _U_) {
+ mka_ckn_info_t *new_rec = (mka_ckn_info_t *)n;
+ const mka_ckn_info_t *old_rec = (const mka_ckn_info_t *)o;
+
+ new_rec->key.ckn_len = old_rec->key.ckn_len;
+ new_rec->key.ckn = (guchar *)g_memdup2(old_rec->key.ckn, old_rec->key.ckn_len);
+ new_rec->key.ckn_len = old_rec->key.ckn_len;
+ new_rec->name = g_strdup(old_rec->name);
+
+ return new_rec;
+}
+
+static bool
+ckn_info_update_cb(void *r, char **err) {
+ mka_ckn_info_t *rec = (mka_ckn_info_t *)r;
+
+ if (rec->key.ckn_len == 0 || rec->key.ckn_len > 32) {
+ *err = ws_strdup_printf("Invalid CKN length! CKNs need to be between 1 and 32 bytes.");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+static void
+ckn_info_free_cb(void *r) {
+ mka_ckn_info_t *rec = (mka_ckn_info_t *)r;
+ g_free(rec->key.ckn);
+ g_free(rec->name);
+}
+
+static void
+ckn_info_reset_cb(void) {
+ if (ht_mka_ckn) {
+ g_hash_table_destroy(ht_mka_ckn);
+ ht_mka_ckn = NULL;
+ }
+}
+
+static void
+ckn_info_post_update_cb(void) {
+ guint i;
+
+ ckn_info_reset_cb();
+
+ ht_mka_ckn = g_hash_table_new(&ckn_key_hash_func, &ckn_key_equal_func);
+
+ for (i = 0; i < num_mka_ckn_uat_data; i++) {
+ g_hash_table_insert(ht_mka_ckn, &(mka_ckn_uat_data[i].key), &(mka_ckn_uat_data[i]));
+ }
+}
+
+static const gchar *
+ckn_info_lookup(guint8 ckn[], guint32 ckn_len) {
+ mka_ckn_info_key_t tmp_key = { .ckn = ckn, .ckn_len = ckn_len };
+
+ if (ht_mka_ckn == NULL) {
+ return NULL;
+ }
+
+ mka_ckn_info_t *tmp = (mka_ckn_info_t *)g_hash_table_lookup(ht_mka_ckn, &tmp_key);
+
+ if (tmp == NULL) {
+ return NULL;
+ }
+
+ return tmp->name;
+}
+
+static void
+mka_add_ckn_info(proto_tree *tree, tvbuff_t *tvb, int offset, guint16 ckn_len) {
+ proto_item *ti;
+
+ guint8 cak_name[32]; /* Only accept CKN between 1 and 32 bytes! */
+ if (1 <= ckn_len && ckn_len <= 32) {
+ tvb_memcpy(tvb, cak_name, offset, ckn_len);
+
+ const gchar *tmp_string = ckn_info_lookup(cak_name, ckn_len);
+ if (tmp_string != NULL) {
+ ti = proto_tree_add_string(tree, hf_mka_cak_name_info, tvb, offset, ckn_len, tmp_string);
+ proto_item_set_generated(ti);
+ }
+ }
+}
+
+
static void
dissect_basic_paramset(proto_tree *mka_tree, packet_info *pinfo, tvbuff_t *tvb, int *offset_ptr)
{
@@ -209,6 +367,7 @@ dissect_basic_paramset(proto_tree *mka_tree, packet_info *pinfo, tvbuff_t *tvb,
cak_len = basic_param_set_len - 28;
proto_tree_add_item(basic_param_set_tree, hf_mka_cak_name,
tvb, offset, cak_len, ENC_NA);
+ mka_add_ckn_info(basic_param_set_tree, tvb, offset, cak_len);
offset += cak_len;
if (basic_param_set_len%4) {
@@ -332,29 +491,44 @@ dissect_sak_use(proto_tree *mka_tree, packet_info *pinfo _U_, tvbuff_t *tvb, int
offset += 2;
- proto_tree_add_item(sak_use_set_tree, hf_mka_latest_key_server_mi,
- tvb, offset, 12, ENC_NA);
- offset += 12;
+ /*
+ * 802.1X-2020 specifies only 0 or 40 are valid! See Figure 11-10 Note d
+ */
+ if (sak_use_len == 0) /* MACsec not supported */
+ {
+ /* Nothing */
+ }
+ else if (sak_use_len == 40) /* MACsec supported */
+ {
+ proto_tree_add_item(sak_use_set_tree, hf_mka_latest_key_server_mi,
+ tvb, offset, 12, ENC_NA);
+ offset += 12;
- proto_tree_add_item(sak_use_set_tree, hf_mka_latest_key_number,
- tvb, offset, 4, ENC_NA);
- offset += 4;
+ proto_tree_add_item(sak_use_set_tree, hf_mka_latest_key_number,
+ tvb, offset, 4, ENC_NA);
+ offset += 4;
- proto_tree_add_item(sak_use_set_tree, hf_mka_latest_lowest_acceptable_pn,
- tvb, offset, 4, ENC_NA);
- offset += 4;
+ proto_tree_add_item(sak_use_set_tree, hf_mka_latest_lowest_acceptable_pn,
+ tvb, offset, 4, ENC_NA);
+ offset += 4;
- proto_tree_add_item(sak_use_set_tree, hf_mka_old_key_server_mi,
- tvb, offset, 12, ENC_NA);
- offset += 12;
+ proto_tree_add_item(sak_use_set_tree, hf_mka_old_key_server_mi,
+ tvb, offset, 12, ENC_NA);
+ offset += 12;
- proto_tree_add_item(sak_use_set_tree, hf_mka_old_key_number,
- tvb, offset, 4, ENC_NA);
- offset += 4;
+ proto_tree_add_item(sak_use_set_tree, hf_mka_old_key_number,
+ tvb, offset, 4, ENC_NA);
+ offset += 4;
- proto_tree_add_item(sak_use_set_tree, hf_mka_old_lowest_acceptable_pn,
- tvb, offset, 4, ENC_NA);
- offset += 4;
+ proto_tree_add_item(sak_use_set_tree, hf_mka_old_lowest_acceptable_pn,
+ tvb, offset, 4, ENC_NA);
+ offset += 4;
+ }
+ else
+ {
+ proto_tree_add_expert(sak_use_set_tree, pinfo, &ei_mka_undecoded, tvb, offset, sak_use_len);
+ offset += sak_use_len;
+ }
*offset_ptr = offset;
}
@@ -459,6 +633,7 @@ dissect_distributed_cak(proto_tree *mka_tree, packet_info *pinfo _U_, tvbuff_t *
cak_len = distributed_cak_len - 24;
proto_tree_add_item(distributed_cak_tree, hf_mka_cak_name,
tvb, offset, cak_len, ENC_NA);
+ mka_add_ckn_info(distributed_cak_tree, tvb, offset, cak_len);
offset += cak_len;
if (distributed_cak_len%4) {
@@ -507,6 +682,7 @@ dissect_announcement(proto_tree *mka_tree, packet_info *pinfo, tvbuff_t *tvb, in
guint16 announcement_len;
proto_tree *announcement_set_tree;
proto_tree *ti;
+ int offset2;
announcement_len = (tvb_get_ntohs(tvb, offset + 2)) & 0x0fff;
ti = proto_tree_add_item(mka_tree, hf_mka_announcement_set, tvb, offset, announcement_len + 4, ENC_NA);
@@ -521,11 +697,72 @@ dissect_announcement(proto_tree *mka_tree, packet_info *pinfo, tvbuff_t *tvb, in
tvb, offset, 2, announcement_len);
offset += 2;
- // See IEEE 802.1X-2010, Section 11.11.1, Figure 11-15 and Section 11.12
- proto_tree_add_expert(announcement_set_tree, pinfo, &ei_mka_unimplemented, tvb, offset, announcement_len);
+ offset2 = 0;
+ while (offset2 + 2 <= announcement_len) {
+ proto_tree *tlv_tree;
+ guint8 tlv_type = ((tvb_get_guint8(tvb, offset + offset2)) & 0xfe ) >> 1;
+ guint16 tlv_length = (tvb_get_ntohs(tvb, offset + offset2)) & 0x01ff;
+ guint16 tlv_item_offset;
+
+ if (offset2 + 2 + tlv_length > announcement_len) {
+ break;
+ }
+
+ ti = proto_tree_add_none_format(announcement_set_tree, hf_mka_tlv_entry, tvb, offset + offset2, tlv_length + 2, "TLV entry: %s",
+ val_to_str(tlv_type, macsec_tlvs, "unknown TLV type: %d"));
+ tlv_tree = proto_item_add_subtree(ti, ett_mka_tlv);
+
+ proto_tree_add_item(tlv_tree, hf_mka_tlv_type, tvb, offset + offset2, 1, ENC_NA);
+ proto_tree_add_item(tlv_tree, hf_mka_tlv_info_string_length, tvb, offset + offset2, 2, ENC_NA);
+ offset2 += 2;
+
+ if (tlv_length > 0) {
+ switch (tlv_type) {
+ case 112: // MACsec Cipher Suites
+ tlv_item_offset = 0;
+ while (tlv_item_offset + 10 <= tlv_length) {
+ proto_tree *cipher_suite_entry;
+ guint64 cipher_suite_id = tvb_get_guint64(tvb, offset + offset2 + tlv_item_offset + 2, ENC_BIG_ENDIAN);
+ guint16 cipher_suite_cap = tvb_get_guint16(tvb, offset + offset2 + tlv_item_offset, ENC_BIG_ENDIAN) & 0x0003;
+
+ ti = proto_tree_add_none_format(tlv_tree, hf_mka_tlv_entry, tvb, offset + offset2, tlv_length + 2, "Cipher Suite: %s, %s",
+ val64_to_str(cipher_suite_id, macsec_cipher_suite_vals, "Unknown Cipher Suite (0x%" PRIx64 ")"),
+ val_to_str(cipher_suite_cap, macsec_capability_type_vals, "Unknown Capability (%d)"));
+ cipher_suite_entry = proto_item_add_subtree(ti, ett_mka_cipher_suite_entry);
+
+ proto_tree_add_item(cipher_suite_entry, hf_mka_tlv_cipher_suite_impl_cap, tvb, offset + offset2 + tlv_item_offset, 2, ENC_NA);
+ tlv_item_offset += 2;
+ proto_tree_add_item(cipher_suite_entry, hf_mka_macsec_cipher_suite, tvb, offset + offset2 + tlv_item_offset, 8, ENC_NA);
+ tlv_item_offset += 8;
+ }
+ break;
+
+ case 111: // Access Information
+ case 113: // Key Management Domain
+ case 114: // NID (Network Identifier)
+ // See IEEE 802.1X-2010, Section 11.11.1, Figure 11-15 and Section 11.12
+ proto_tree_add_expert(tlv_tree, pinfo, &ei_mka_unimplemented, tvb, offset + offset2, tlv_length);
+ proto_tree_add_item(tlv_tree, hf_mka_tlv_data, tvb, offset + offset2, tlv_length, ENC_NA);
+ break;
+
+ default:
+ proto_tree_add_item(tlv_tree, hf_mka_tlv_data, tvb, offset + offset2, tlv_length, ENC_NA);
+ }
+ offset2 += tlv_length;
+ }
+ }
offset += announcement_len;
+ if (announcement_len%4) {
+ int padding_len = (4 - (announcement_len % 4));
+
+ proto_tree_add_item(announcement_set_tree, hf_mka_padding,
+ tvb, offset, padding_len, ENC_NA);
+
+ offset += padding_len;
+ }
+
*offset_ptr = offset;
}
@@ -705,15 +942,18 @@ dissect_mka(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
void
proto_register_mka(void)
{
+ module_t *mka_module;
expert_module_t *expert_mka = NULL;
+ uat_t *mka_ckn_info_uat = NULL;
+
static ei_register_info ei[] = {
{ &ei_mka_undecoded, {
"mka.expert.undecoded_data", PI_UNDECODED, PI_WARN, "Undecoded data", EXPFILL }},
{ &ei_unexpected_data, {
"mka.expert.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }},
{ &ei_mka_unimplemented, {
- "mka.expert.unimplemented", PI_UNDECODED, PI_WARN, "Announcement TLVs not handled, if you want this implemented please contact the wireshark developers", EXPFILL }}
+ "mka.expert.unimplemented", PI_UNDECODED, PI_WARN, "Announcement TLV not handled, if you want this implemented please contact the wireshark developers", EXPFILL }}
};
static hf_register_info hf[] = {
@@ -837,6 +1077,11 @@ proto_register_mka(void)
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
+ { &hf_mka_cak_name_info, {
+ "CAK Name Info", "mka.cak_name.info",
+ FT_STRING, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
{ &hf_mka_padding, {
"Padding", "mka.padding",
FT_BYTES, BASE_NONE, NULL, 0x0,
@@ -913,7 +1158,7 @@ proto_register_mka(void)
NULL, HFILL }},
{ &hf_mka_latest_lowest_acceptable_pn, {
- "Latest Key: Lowest Acceptable PN", "mka.latest_lowest_acceptable_pn",
+ "Latest Key: Lowest Acceptable PN (32 MSB)", "mka.latest_lowest_acceptable_pn",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
@@ -928,7 +1173,7 @@ proto_register_mka(void)
NULL, HFILL }},
{ &hf_mka_old_lowest_acceptable_pn, {
- "Old Key: Lowest Acceptable PN", "mka.old_lowest_acceptable_pn",
+ "Old Key: Lowest Acceptable PN (32 MSB)", "mka.old_lowest_acceptable_pn",
FT_BYTES, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
@@ -975,7 +1220,32 @@ proto_register_mka(void)
{ &hf_mka_icv, {
"Integrity Check Value", "mka.icv",
FT_BYTES, BASE_NONE, NULL, 0x0,
- NULL, HFILL }}
+ NULL, HFILL }},
+
+ { &hf_mka_tlv_entry, {
+ "TLV Entry", "mka.tlv_entry",
+ FT_NONE, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_mka_tlv_type, {
+ "TLV Type", "mka.tlv_type",
+ FT_UINT8, BASE_DEC, VALS(macsec_tlvs), 0xfe,
+ NULL, HFILL }},
+
+ { &hf_mka_tlv_info_string_length, {
+ "TLV Info String Length", "mka.tlv_info_string_len",
+ FT_UINT16, BASE_DEC, NULL, 0x01ff,
+ NULL, HFILL }},
+
+ { &hf_mka_tlv_data, {
+ "TLV Data", "mka.tlv_data",
+ FT_BYTES, BASE_NONE, NULL, 0x0,
+ NULL, HFILL }},
+
+ { &hf_mka_tlv_cipher_suite_impl_cap, {
+ "Cipher Suite Implementation Cababilities", "mka.tlv.cipher_suite_impl_cap",
+ FT_UINT16, BASE_DEC, VALS(macsec_capability_type_vals), 0x0003,
+ NULL, HFILL }},
};
static gint *ett[] = {
@@ -989,7 +1259,9 @@ proto_register_mka(void)
&ett_mka_announcement_set,
&ett_mka_xpn_set,
&ett_mka_unknown_set,
- &ett_mka_icv_set
+ &ett_mka_icv_set,
+ &ett_mka_tlv,
+ &ett_mka_cipher_suite_entry
};
proto_mka = proto_register_protocol("MACsec Key Agreement", "EAPOL-MKA", "mka");
@@ -1001,6 +1273,33 @@ proto_register_mka(void)
expert_mka = expert_register_protocol(proto_mka);
expert_register_field_array(expert_mka, ei, array_length(ei));
+ mka_module = prefs_register_protocol(proto_mka, NULL);
+
+ /* UAT: CKN info */
+ static uat_field_t mka_ckn_uat_fields[] = {
+ UAT_FLD_BUFFER(mka_ckn_uat_data, ckn, "CKN", "The CKN as byte array"),
+ UAT_FLD_CSTRING(mka_ckn_uat_data, name, "Info", "CKN information string to be displayed"),
+ UAT_END_FIELDS
+ };
+
+ mka_ckn_info_uat = uat_new("CKN Info",
+ sizeof(mka_ckn_info_t), /* record size */
+ DATAFILE_CKN_INFO, /* filename */
+ TRUE, /* from profile */
+ (void **) &mka_ckn_uat_data, /* data_ptr */
+ &num_mka_ckn_uat_data, /* numitems_ptr */
+ UAT_AFFECTS_DISSECTION, /* but not fields */
+ NULL, /* help */
+ ckn_info_copy_cb, /* copy callback */
+ ckn_info_update_cb, /* update callback */
+ ckn_info_free_cb, /* free callback */
+ ckn_info_post_update_cb, /* post update callback */
+ ckn_info_reset_cb, /* reset callback */
+ mka_ckn_uat_fields /* UAT field definitions */
+ );
+
+ prefs_register_uat_preference(mka_module, "ckn_info", "CKN Info",
+ "A table to define names of CKNs", mka_ckn_info_uat);
}
void