DAG-CBOR only supports a subset of CBOR. Especially for the FVM we should be strict about (de)serializing only valid DAG-CBOR. DAG-CBOR supports:
- From all major types: only finite length major types. Not infinite length ones.
- From major type 6: only tag 42 (CID) is supported, which is encoded as
0xd8 0x2a. Not any other tag.
- From major type 7:
- Only finite 64-bit floats. i.e. for major type 7 only the
0xfb byte. Not 16-bit (0xf9), 32-bit (0xfa).
- Only the simple values
false (0xf4), true (0xf5) and null (0xf6). Not simple values (0xe0…0xf3), undefined (0xf7), simple value, one byte follows (0xf8), "break" stop code (0xff).
The development will happen within the DAG-CBOR library, but I opened the issue here for tracking purpose.
DAG-CBOR only supports a subset of CBOR. Especially for the FVM we should be strict about (de)serializing only valid DAG-CBOR. DAG-CBOR supports:
0xd8 0x2a. Not any other tag.0xfbbyte. Not 16-bit (0xf9), 32-bit (0xfa).false(0xf4),true(0xf5) andnull(0xf6). Not simple values (0xe0…0xf3),undefined(0xf7), simple value, one byte follows (0xf8), "break" stop code (0xff).The development will happen within the DAG-CBOR library, but I opened the issue here for tracking purpose.