Subject: [Cbor] Simple Value Example

From: Richter, Jörg <[email-masked]>
Date: Wed, 30 Jan 2019 09:00:57 +0000

From reading the archives I get the impression that simple values < 32
should always use the short encoding.

But Appendix A has an example for “0xf818” which decodes to simple(24).
I think this should be removed in this case.

BTW: Is there a collection of “corrupt” CBOR messages that must produce
a decode error?

- Jörg

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 30 Jan 2019 10:41:33 +0100

> should always use the short encoding.

Actually, < 24, because there is no way to use a single-byte encoding otherwise.
 
> I think this should be removed in this case.

Actually, it probably should be simple(32) or 0xf820:
Table 2 says:

                       | 24..31  | (Reserved)      |

because the text in front of it says about the two-byte encoding:
   […]  (To minimize confusion, only the values 32 to 255 are
   used.)  […]

This is clearly in invalid example, thank you for noting this.
Now issue #53:

https://github.com/cbor-wg/CBORbis/issues/53
 
> BTW: Is there a collection of “corrupt” CBOR messages that must produce

We have talked about this:

https://github.com/cbor-wg/CBORbis/issues/16

But so far nobody has started collecting instances.
Do you have some we could start with?
I was planning to scan some of the open source CBOR packages for tests of failing decoding.

Grüße, Carsten