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

CBOR tagged data can't be deserialized #1560

Open
wkornewald opened this issue Jun 18, 2021 · 4 comments
Open

CBOR tagged data can't be deserialized #1560

wkornewald opened this issue Jun 18, 2021 · 4 comments
Labels
bug cbor up for grabs A good issue for external contribution

Comments

@wkornewald
Copy link

wkornewald commented Jun 18, 2021

Describe the bug

When you have CBOR data that is tagged, deserialization fails with an exception. With tags I'm referring to section 3.4 of the RFC:

https://datatracker.ietf.org/doc/html/rfc8949#section-3.4

In our case for the CovPass / covid vaccination certificate app some countries use tag 0 to annotate strings as being in date/time format.

The other issue is that we can't decode the COSE data format because the array is tagged with 18:

https://cose-wg.github.io/cose-spec/#rfc.appendix.C.2.1

  1. By default, tags should just be ignored during deserialization.
  2. We could need an annotation that a certain tag should be used for serialization and optionally also be required during deserialization.
  3. For more dynamic tagging something like a special CborTagged(tag, data) object would be nice which allows extracting arbitrary tags (or null) during deserialization and setting arbitrary tags during serialization.

Environment

  • Kotlin version: 1.5.10
  • Library version: 1.2.1
@sandwwraith sandwwraith added the up for grabs A good issue for external contribution label May 12, 2023
@sandwwraith
Copy link
Member

Does #1614 solve this? It ignores tags by default

@wkornewald
Copy link
Author

Not really. We need to be able to work with the tags, i.e. match them or extract them and set them.

@sandwwraith
Copy link
Member

I'll leave this open then

@JesusMcCloud
Copy link

see #2412

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cbor up for grabs A good issue for external contribution
Projects
None yet
Development

No branches or pull requests

3 participants