Wireshark 4.5.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
packet-cose.h
1/* packet-cose.h
2 * Definitions for CBOR Object Signing and Encryption (COSE) dissection
3 * References:
4 * RFC 9052: https://tools.ietf.org/html/rfc9052
5 *
6 * Copyright 2019-2021, Brian Sipos <brian.sipos@gmail.com>
7 *
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
11 *
12 * SPDX-License-Identifier: LGPL-2.1-or-later
13 */
14#ifndef __PACKET_COSE_H__
15#define __PACKET_COSE_H__
16
17#include <ws_symbol_export.h>
18#include <glib.h>
19#include <stdint.h>
20
21#ifdef __cplusplus
22extern "C" {
23#endif
24
48// A header parameter or key-type parameter key
49typedef struct {
52 GVariant *principal;
53
56 GVariant *label;
58
61WS_DLL_PUBLIC
62unsigned cose_param_key_hash(const void *ptr);
63
66WS_DLL_PUBLIC
67gboolean cose_param_key_equal(const void *a, const void *b);
68
71WS_DLL_PUBLIC
72void cose_param_key_free(void *ptr);
73
75typedef struct {
77 GVariant *principal;
79 GVariant *label;
81
83typedef struct {
85 int64_t value;
92 unsigned out_len;
94
100WS_DLL_PUBLIC
101const cose_hash_props_t * cose_get_hash_props(int64_t alg);
102
104typedef struct {
106 int64_t value;
112 unsigned key_len;
114 unsigned iv_len;
116 unsigned tag_len;
118
124WS_DLL_PUBLIC
125const cose_aead_props_t * cose_get_aead_props(int64_t alg);
126
128typedef struct {
130 int64_t value;
132 unsigned pubkey_len;
134
140WS_DLL_PUBLIC
141const cose_ecc_props_t * cose_get_ecc_props(int64_t crv);
142
143#ifdef __cplusplus
144}
145#endif
146
147#endif /* __PACKET_COSE_H__ */
Derived properties of AEAD encryption algorithm.
Definition packet-cose.h:104
int gcry_mode
GCrypt mode enumeration.
Definition packet-cose.h:110
unsigned key_len
Key length in bytes.
Definition packet-cose.h:112
unsigned tag_len
Tag length in bytes.
Definition packet-cose.h:116
unsigned iv_len
IV length in bytes.
Definition packet-cose.h:114
int gcry_cipher
GCrypt cipher enumeration.
Definition packet-cose.h:108
int64_t value
The algorithm code point.
Definition packet-cose.h:106
Derived properties of AEAD encryption algorithm.
Definition packet-cose.h:128
unsigned pubkey_len
Public key encoded size in bytes.
Definition packet-cose.h:132
int64_t value
The algorithm code point.
Definition packet-cose.h:130
Derived properties of hash algorithm.
Definition packet-cose.h:83
unsigned out_len
Definition packet-cose.h:92
int gcry_hash
GCrypt hash enumeration.
Definition packet-cose.h:87
int64_t value
The algorithm code point.
Definition packet-cose.h:85
User data for header/key-parameter dissectors.
Definition packet-cose.h:75
GVariant * principal
Principal value (alg or kty) of the map, if defined.
Definition packet-cose.h:77
GVariant * label
Current label being processed.
Definition packet-cose.h:79
Definition packet-cose.h:49
GVariant * principal
Definition packet-cose.h:52
GVariant * label
Definition packet-cose.h:56