Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix cbor.SimpleValue encoding and decoding
This commit resolves two issues: 1. Encoding cbor.SimpleValue with values 24..31 should fail because CBOR simple values 24..31 are reserved and they MUST NOT be encoded according to RFC 8949. This commit makes encoder return UnsupportedValueError when encoding cbor.SimpleValue with values 24..31 because that would not be a well-formed CBOR data item. 2. Decoding other CBOR types to cbor.SimpleValue should fail because cbor.SimpleValue represents CBOR simple value (major type 7) which is different from CBOR integers and shouldn't be used interchangeably. This commit makes decoder return UnmarshalTypeError when decoding other CBOR types to cbor.SimpleValue.
- Loading branch information