Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cbor.SimpleValue encoding and decoding #464

Merged
merged 1 commit into from
Jan 2, 2024

Commits on Jan 2, 2024

  1. 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.
    fxamacker committed Jan 2, 2024
    Configuration menu
    Copy the full SHA
    bfcaa81 View commit details
    Browse the repository at this point in the history