2 * Definitions for CBOR Object Signing and Encryption (COSE) dissection
4 * RFC 9052: https://tools.ietf.org/html/rfc9052
6 * Copyright 2019-2021, Brian Sipos <brian.sipos@gmail.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * SPDX-License-Identifier: LGPL-2.1-or-later
14 #ifndef __PACKET_COSE_H__
15 #define __PACKET_COSE_H__
20 * COSE message dissectors are registered multiple ways:
21 * 1. The unit-keyed dissector table "cose.msgtag" with keys being
22 * IANA-registered CBOR tag values (e.g., 18 is COSE_Sign1).
23 * 2. The string-keyed dissector table "media_type" with the IANA-registered
24 * key "application/cose" and subtypes registered in dissector table
25 * "cose.mediasub" (e.g., "cose-sign1" is COSE_Sign1).
26 * 3. The registered dissectors for names "cose" and message names in
27 * all-lowercase form (e.g., "cose_sign1").
29 * COSE message dissectors use the tag (wscbor_tag_t *) value, if used to
30 * discriminate the message type, as the user data pointer.
32 * COSE header label dissectors are registered with the dissector table
33 * "cose.header" and key parameter dissectors with the table "cose.keyparam"
34 * both with cose_param_key_t* keys.
35 * The header/parameter dissectors use a cose_header_context_t* as the user
38 * An additional dissector "cose.msg.headers" will dissect an individual
39 * header map structure outside of a COSE message.
42 // A header parameter or key-type parameter key
44 /// The Algorithm or Key Type context or NULL for
48 /// Label simple value (int or tstr) as variant.
49 /// Object owned by this struct.
53 /** Compatible with GHashFunc signature.
55 unsigned cose_param_key_hash(const void *ptr
);
57 /** Compatible with GEqualFunc signature.
59 gboolean
cose_param_key_equal(const void *a
, const void *b
);
61 /** Compatible with GDestroyNotify signature.
63 void cose_param_key_free(void *ptr
);
65 /// User data for header/key-parameter dissectors
67 /// Principal value (alg or kty) of the map, if defined.
69 /// Current label being processed
71 } cose_header_context_t
;
73 #endif /* __PACKET_COSE_H__ */