CBOR: Add self describing CBOR tag at the beginning

This commit is contained in:
2023-04-19 09:53:25 +02:00
parent f471e0925d
commit d2df1b3ce3
4 changed files with 63 additions and 16 deletions
@@ -587,6 +587,11 @@ std::unique_lock<std::mutex> ul(m);
CborParser parser;
CborValue value;
cborErr(cbor_parser_init(buffer.data(), buffer.size(), 0, &parser, &value));
if (GetCBORTag(value) != SelfDescribedCBOR)
throw JFJochException(JFJochExceptionCategory::CBORError, "CBOR must start with dedicated tag");
if (cbor_value_is_map(&value)) {
CborValue map_value;
cborErr(cbor_value_enter_container(&value, &map_value));