c2pa-rs icon indicating copy to clipboard operation
c2pa-rs copied to clipboard

CBOR generated by `test_build_assertion` may be invalid

Open scouten-adobe opened this issue 2 years ago • 3 comments

I saved a copy of the CBOR generated in one of our tests (see https://github.com/contentauth/c2pa-rs/blob/main/sdk/src/assertions/actions.rs#L450).

It contains several (hex) ef bf bd sequences which do not make sense as initial values in CBOR:

  • ef = major type 7, minor value 15, which is unassigned
  • bf = major type 5 (map), indefinite length, which is legal
  • bd = major type 5 (map), minor value 29, which would be legal, but there are not 29 key/value pairs in the subsequent data

This file also is rejected by the third-party cbor-diag parser.

scouten-adobe avatar Dec 05 '22 23:12 scouten-adobe

xxd /path/to/actions-460-build-assertion.cbor

00000000: efbf bd67 6163 7469 6f6e 73ef bfbd efbf  ...gactions.....
00000010: bd66 6163 7469 6f6e 6c63 3270 612e 6372  .factionlc2pa.cr
00000020: 6f70 7065 646a 7061 7261 6d65 7465 7273  oppedjparameters
00000030: efbf bd6a 636f 6f72 6469 6e61 7465 78ef  ...jcoordinatex.
00000040: bfbd 7b0a 2020 2020 2020 2020 2020 2020  ..{.
00000050: 2020 2020 2020 2020 2020 2020 226c 6566              "lef
00000060: 7422 3a20 302c 0a20 2020 2020 2020 2020  t": 0,.
00000070: 2020 2020 2020 2020 2020 2020 2020 2022                 "
00000080: 7269 6768 7422 3a20 3230 3030 2c0a 2020  right": 2000,.
00000090: 2020 2020 2020 2020 2020 2020 2020 2020
000000a0: 2020 2020 2020 2274 6f70 223a 2031 3030        "top": 100
000000b0: 302c 0a20 2020 2020 2020 2020 2020 2020  0,.
000000c0: 2020 2020 2020 2020 2020 2022 626f 7474             "bott
000000d0: 6f6d 223a 2034 3030 300a 2020 2020 2020  om": 4000.
000000e0: 2020 2020 2020 2020 2020 2020 2020 7def                }.
000000f0: bfbd 6661 6374 696f 6e6d 6332 7061 2e66  ..factionmc2pa.f
00000100: 696c 7465 7265 6464 7768 656e 7818 3230  iltereddwhenx.20
00000110: 3135 2d30 362d 3236 5431 363a 3433 3a32  15-06-26T16:43:2
00000120: 332b 3032 3030 6a70 6172 616d 6574 6572  3+0200jparameter
00000130: 73ef bfbd 646e 616d 656d 6761 7573 7369  s...dnamemgaussi
00000140: 616e 2062 6c75 72                        an blur

scouten-adobe avatar Dec 05 '22 23:12 scouten-adobe

:white_check_mark: Jira issue https://jira.corp.adobe.com/browse/CAI-3366 is successfully created for this GitHub issue.

github-jira-sync-bot avatar Jan 23 '23 19:01 github-jira-sync-bot