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 validation not works #256

Open
rickou opened this issue Oct 22, 2024 · 0 comments
Open

CBOR validation not works #256

rickou opened this issue Oct 22, 2024 · 0 comments

Comments

@rickou
Copy link

rickou commented Oct 22, 2024

hi,

i try to validate my CBOR stream using cbor_value_validate_basic.

i always get error with the first signature tag (even if the stream is ok)
D9D9F7A300A300196BCF010002C11A3843138001A100F502A100A300F401F93C0002F94D00

the decoded form is:

d9 d9f7                 # self describe cbor, tag(55799)
   a3                   #   map(3)
      00                #     unsigned(0)
      a3                #     map(3)
         00             #       unsigned(0)
         19 6bcf        #       unsigned(27,599)
         01             #       unsigned(1)
         00             #       unsigned(0)
         02             #       unsigned(2)
         c1             #       epoch datetime value, tag(1)
            1a 38431380 #         unsigned(943,920,000)
                        #         datetime(1999-11-30T00:00:00Z)
      01                #     unsigned(1)
      a1                #     map(1)
         00             #       unsigned(0)
         f5             #       true, simple(21)
      02                #     unsigned(2)
      a1                #     map(1)
         00             #       unsigned(0)
         a3             #       map(3)
            00          #         unsigned(0)
            f4          #         false, simple(20)
            01          #         unsigned(1)
            f9 3c00     #         float(1)
            02          #         unsigned(2)
            f9 4d00     #         float(20)

if i skip the signature tag before calling cbor_value_validate_basic and introduce a bad map definition (2 declared and 3 items)
D9D9F7A300**A2**00196BCF010002C11A3843138001A100F502A100A300F401F93C0002F94D00
The function returns no error.

using https://cbor.nemo157.com/, the stream problem is identified.
Error: TODO cbor-diag::Error: Remaining bytes (02a100a300f401f93c0002f94d00)

I have not identified in the lib where can be the problem except after returning, the remaining field is not 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant