Wireshark mailing list archives

Common CBOR decoding API


From: Brian Sipos <BSipos () rkf-eng com>
Date: Wed, 3 Mar 2021 13:32:43 +0000

All,
While developing a dissector for a CBOR-based protocol, I notice that there is no API-level handling of CBOR in 
wireshark in the same way that there is for some other encodings (e.g., ASN.1 OID encoding of [1]) there is just the 
dissector-level decoding of [2].

Since CBOR is being used in a variety of new protocols, especially related to CoAP, does it make sense to have 
library-level handling of CBOR?
I offer my existing, narrowly-scoped API [3] as a starting point. Some of its names must change, and explicit 
`wmem_allocator_t` input added to allocators, but I believe there is value in having a common and well-tested API for 
these CBOR-based protocols.
Some existing wireshark handlers of CBOR are not robust to things like unexpected tags or unexpected major types in the 
encoded stream, which having a common API would help with.

[1] https://gitlab.com/wireshark/wireshark/-/blob/master/epan/oids.h
[2] https://gitlab.com/wireshark/wireshark/-/blob/master/epan/dissectors/packet-cbor.c
[3] https://github.com/BSipos-RKF/dtn-wireshark/blob/master/src/bp_cbor.h

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: