diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a98b3d..d1b0f20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,49 @@ else. ## Unreleased +### An appended trailer no longer accuses a file with a genuine sidecar — corpus 6.1.0 → **6.2.0** + +**Breaking** for verifiers (a reading rule changed), not for the corpus: no +committed vector moved bytes or verdict, so the bump is minor (`vectors/README.md`, +*Bump policy*). Corpus 6.2.0 (174 vectors). + +§3.1. Before: a valid footer whose CRC matched made the trailer the proof +(step 1), and a differing sidecar was only *sidecar differs*. A valid-CRC +trailer proves nothing about which file it was sealed with, so anyone could +append one carrying another capture's proof to a trailer-stripped genuine +file next to its genuine sidecar, and the verdict was **tampered** (or +*frames not compared* on a clip) — the shape 6.1.0 closed for a forged +manifest and left open here. Now one rule, *A sidecar that does better*, +covers both: when a sidecar differs from the proof the file carries (the +trailer at step 1, the depth-0 proof at step 4), a verifier computes both +verdicts over the same canonical bytes (the file without the trailer at +step 1) and ranks outcomes (*authentic* > *verified clip* > *frames not +compared* > everything else). The sidecar decides only when it ranks +**strictly above**; its verdict then carries *trailer copy differs* (new +label) or *manifest copy differs*, `proof_source` `sidecar`, and the active +manifest's copy, if any, is compared with the sidecar instead. On a tie the +file's proof stands with *sidecar differs*, as before. Outcomes, never +ceilings, are ranked. Nothing is gained that deleting the trailer would not +give. A sidecar identical to the trailer changes nothing. + +Unchanged and outside the rule: a nested trailer stays *nested proof* +(structural; deleting the outer trailer leaves the inner one to step 1); a +footer whose CRC fails or whose major is not 1 stays *corrupted proof* or +*unsupported format version* whatever the sidecar says (steps 2–3: no proof +is judged, nothing to rank). **Open**: such a footer appended to a stripped +genuine file still accuses it; recorded in `threat-model.md` §5.1. + +- **New**: 172 (JPEG: vector 05's photo with another capture's valid trailer + appended, vector 01's proof as sidecar → *authentic*, *trailer copy + differs*), 173 (vector 89's clip, trailer replaced by a foreign video proof + that reads *frames not compared*, vector 166's proof as sidecar → *verified + clip* 1–2 of 3, *trailer copy differs*), 174 (vector 11's tampered file, + vector 18's sidecar, both *tampered* → the trailer stands, *tampered*). + Generated by `generate.ts`. Vector 18 (a tie on *authentic*) is unchanged. + +**What a verifier that predates 6.2.0 does**: reads 172 *tampered* and 173 +*frames not compared*, from the trailer; 174 passes. + ### A forged manifest no longer accuses a file with a genuine sidecar — corpus 6.0.0 → **6.1.0** **Breaking** for verifiers (a reading rule changed), not for the corpus: no diff --git a/spec/c2pa-interop-1.0.md b/spec/c2pa-interop-1.0.md index fd359d6..ae44978 100644 --- a/spec/c2pa-interop-1.0.md +++ b/spec/c2pa-interop-1.0.md @@ -356,7 +356,7 @@ precedence — the copy inside the bytes wins — and the same reason: it travelled with what it binds. Where the shapes part: a manifest is authenticated to a C2PA validator and not to a vcap reader, so a copy in the bytes that does worse over them than a differing sidecar does not win -(`vcap-proof-1.0.md` §3.1, step 4; vectors 169–171) — anyone can write a +(`vcap-proof-1.0.md` §3.1, *A sidecar that does better*; vectors 169–171) — anyone can write a manifest, and the sidecar is what deleting it would leave. ### 3.4 When we sign C2PA @@ -404,7 +404,11 @@ the proof in its own manifest, or find it in its source's (`vcap-proof-1.0.md` file. Neither can forge a core — the signature is over it — but the attachments are where a downgrade would go (a dropped `registry`, a dropped `timestamp`), and the copy inside the file is the harder one to - edit quietly. A broken trailer is not replaced by a sidecar for the same + edit quietly. It wins **ties**, not outcomes: a valid-CRC trailer can be + appended to any trailer-stripped file, so one that does worse over the + bytes than a differing sidecar does not decide (`vcap-proof-1.0.md` §3.1, + *A sidecar that does better*; vectors 172–174) — the downgrade it guards + against is a ceiling, and ceilings are never ranked. A broken trailer is not replaced by a sidecar for the same reason (vector 72): the CRC failing says the file was edited, and a fallback that hid it would answer the question the CRC exists to raise. - **No label for "from sidecar"**, nor for "from a manifest". The location of @@ -445,6 +449,7 @@ canonical bytes. | Copy, transfer, rename | kept | kept | kept | kept | as sealed (level per §7) | same; the sidecar is renamed with the file or is not found | 01, 17 | | Trailer stripped, bytes otherwise intact (a tool that truncates at EOI or drops trailing boxes) | lost | kept | kept, no proof in it | kept | *no proof found* | **full verdict restored**, identical to the embedded one | 05, 17 | | The same, with Content Credentials that carry the proof | lost | kept | kept | kept | **full verdict restored** from the active manifest (`vcap-proof-1.0.md` §3.2, depth 0) | the same: the manifest's copy outranks the sidecar, which *differs* if it is not the same proof — unless the sidecar's outcome is better over these bytes, when the sidecar decides and the manifest's copy *differs* | 124, 127, 169–171 | +| Trailer stripped, another capture's valid trailer appended | replaced | kept | kept | kept | the appended proof's verdict: *tampered* on a photo, *frames not compared* on a video | **restored** from the sidecar when its outcome is better, with *trailer copy differs*; on a tie the appended trailer stands | 172–174 | | C2PA manifest added, replaced or removed on a JPEG | kept | kept | changed | kept | unchanged | unchanged | 02, 68 | | C2PA manifest inserted into a sealed BMFF file | kept | kept | added | kept | *tampered* (§4.1: inside the canonical bytes) | *tampered* | 73 | | C2PA update manifest appended to a sealed BMFF file | unreachable | kept | changed | kept | *no proof found* | *tampered* (whole file hashed) | 69, 70 | @@ -486,7 +491,7 @@ Reading the table: - **What the verifier must say**, in §8's words, per outcome: *no proof found* is not an error and is never *corrupted*; *tampered* carries its reason and no absence labels; *verified clip* names the segments verified - out of `segment_count`; *sidecar differs*, *manifest copy differs* and + out of `segment_count`; *sidecar differs*, *trailer copy differs*, *manifest copy differs* and *flags disagree* are warnings on an otherwise valid verdict; a detector result is *watermark matched*, *watermark not recovered* or *watermark not evaluated*, and a match without a valid signature is *origin traced*. diff --git a/spec/threat-model.md b/spec/threat-model.md index ec74be7..b352d45 100644 --- a/spec/threat-model.md +++ b/spec/threat-model.md @@ -129,6 +129,7 @@ Boundaries, each enforced by code and tested: | Timeline edit | re-muxes a genuine video with an edit list that trims, repeats or reorders what a player shows, every sample untouched | an edit list with more than one edit after the leading delay, or a rate change, is a timeline §5 does not model: no segment is located (§5, vector 156) | none: *frames not compared*, never *verified clip*; an original is covered whole by `media.hash` | | Clip re-timed | re-muxes a genuine clip keeping every sample and the single-edit timeline, and changes sample durations (`stts`), composition offsets (`ctts`), the `mdhd` timescales or the audio sample rate: a frame frozen, a passage slowed, frames reordered within a GOP | none for a clip: no signed byte carries timing; audio assignment by DTS breaks the hashes only when a change moves an IDR relative to the audio | **open**: such a clip reads *verified clip*. An original is covered by `media.hash`. A proposal is in `reviews/design-clip-timing.md` | | Proof transplant | moves a genuine trailer or sidecar onto another file | `media.hash` mismatch; on video, a signed segment counts only where a GOP of the received file names it and recomputes (§5, *Locating segments*) | none: red on a photo; *frames not compared* on a video whose GOPs name no segment of the proof, never *verified clip* | +| Accusing trailer | strips a genuine file's trailer and appends another capture's valid trailer (CRC correct) beside the genuine sidecar, to have the file accused | beside a differing sidecar whose outcome is better over the same bytes, the sidecar decides, with *trailer copy differs* (`vcap-proof-1.0.md` §3.1, *A sidecar that does better*, vectors 172–173); ties keep the trailer (vector 174) | none with the sidecar present: the file reads as the sidecar says. Without it the appended proof decides, as it would on any file. **Open**: a footer whose CRC fails, or whose major is not 1, appended the same way still reads *corrupted proof* or *unsupported format version* whatever the sidecar says (§3.1 steps 2–3) | | Clip from a genuine video | cuts segments, keeps the trailer | per-segment chain over messages; `segment_count`; `media.hash` mismatch → *verified clip*, amber, ranges shown | accepted and **labelled**: a clip is a clip, never an original | | Reassembled video | reorders, repeats or relabels genuine GOPs, or inserts a foreign one next to them | every GOP of the file is accounted for in decode order: one vcap SEI naming this capture and a signed segment, indices strictly increasing, each at most once (§5) | none: red | | Audio replacement on a clip | keeps verified frames, swaps sound | audio frames inside the segment hash (§5) | none on originals and clips | @@ -298,6 +299,11 @@ like, and it is the true one. ## 7. Change log +- 2026-10-03 — §5.1: a valid-CRC trailer appended to a trailer-stripped + genuine file beside its sidecar no longer accuses the file + (`vcap-proof-1.0.md` §3.1, *A sidecar that does better*); an appended + broken or unsupported footer still does, and is recorded as open. + - 2026-10-03 — §5.1: a forged manifest added beside a genuine file and its sidecar no longer accuses the file (`vcap-proof-1.0.md` §3.1 step 4); a re-timed clip is an open residual, with a proposal. diff --git a/spec/vcap-proof-1.0.md b/spec/vcap-proof-1.0.md index 7a82435..dd7de1e 100644 --- a/spec/vcap-proof-1.0.md +++ b/spec/vcap-proof-1.0.md @@ -177,16 +177,18 @@ restore are in `c2pa-interop-1.0.md` §4 and §5. - **Precedence.** Read the last 16 bytes first (§3), then: 1. **Valid footer, CRC matches** → the trailer is the proof. A sidecar, if present, is compared **byte for byte** with the payload; not equal is - *sidecar differs*, a label, and the sidecar is not used for anything - (vector 18). Byte comparison, not semantic: a writer emits canonical bytes + *sidecar differs*, a label, and the sidecar is not used (vector 18) — + **unless it does better over the same bytes** (*A sidecar that does + better*, below; vectors 172–174). Byte comparison, not semantic: a writer emits canonical bytes in both places and the label is a writer bug or a swapped file, either of which the reader should say rather than resolve. The copy the file's active C2PA manifest carries, if any (§3.2), is compared too, as `JCS(parse(copy)) == JCS(parse(payload))` — a claim generator re-serializes the JSON it is given, so bytes are not comparable across a manifest (vector 123) — and not equal is *manifest copy differs*, a label; - the copy is not used for anything (vector 125). A copy that is not a - well-formed proof (§6.1) differs from any other. + the copy is not used for anything (vector 125). It is compared with the + proof that decides, the sidecar's when the sidecar does. A copy that is + not a well-formed proof (§6.1) differs from any other. 2. **Valid footer, CRC fails** → *corrupted proof*, whatever the sidecar or a C2PA store says (vectors 72, 126). The sidecar is a fallback for a trailer that is absent, not a substitute for one that was found and is @@ -202,25 +204,9 @@ restore are in `c2pa-interop-1.0.md` §4 and §5. sidecar, which is presented as this file's proof, outranks a source's (vector 130). A sidecar next to a depth-0 proof is compared with it as JCS; not equal is *sidecar differs*, and the sidecar is not used - (vector 127) — **unless it does better over the same bytes**. A - manifest is not authenticated to a reader and, on a JPEG, sits outside - the canonical bytes (§4.1): anyone can add one carrying another capture's - proof beside a genuine file and its genuine sidecar, and a depth-0 proof - that always won would turn that into an accusation (vector 169). So when - the two differ, a verifier computes the verdict of each, as this step - says for either, and ranks their outcomes: *authentic* above *verified - clip* above *frames not compared* above every other outcome, which rank - equal. When the sidecar's outcome ranks **strictly above** the depth-0 - proof's, the sidecar's verdict is the verdict, `proof_source` is - `sidecar`, and it carries *manifest copy differs* instead of *sidecar - differs* (vectors 169, 171). Otherwise the depth-0 proof's verdict stands - with *sidecar differs* (vectors 127, 170). Only outcomes are ranked, - never ceilings: a sidecar stripped of a `revoked` `attestation_status` - reads amber where the manifest's complete copy reads red, and must not - win. Nothing is gained this way that - deleting the manifest would not give — the sidecar is the next proof in - this order — and the manifest's copy can still lower a ceiling on a tie, - never raise one. The same holds for a store the caller hands over. + (vector 127) — **unless it does better over the same bytes** (*A + sidecar that does better*, below; vectors 169–171). The same holds for + a store the caller hands over. The canonical bytes are the **whole** received file (§4.1 step 1, `F' = F`), including whatever a stale or displaced trailer left behind (vector 70). The verdict is computed exactly as for an embedded @@ -231,6 +217,38 @@ restore are in `c2pa-interop-1.0.md` §4 and §5. is a proof found at depth ≥ 1, which is not presented as this file's (§3.2, *The verdict*). 5. **None of these** → *no proof found*. +- **A sidecar that does better.** Neither the proof a file carries nor its + place is authenticated as this file's: a C2PA manifest is not authenticated + to a reader and, on a JPEG, sits outside the canonical bytes (§4.1), and a + trailer with a valid CRC can be appended to any trailer-stripped file. So + anyone can put another capture's proof in either beside a genuine file and + its genuine sidecar, and a file's proof that always won would turn that into + an accusation (vectors 169, 172). When a sidecar differs from the proof the + file carries — the trailer at step 1, the depth-0 proof at step 4 — a + verifier computes the verdict of each over the same canonical bytes (the + file without the trailer at step 1, the whole file at step 4), and ranks + their **outcomes**: *authentic* above *verified clip* above *frames not + compared* above every other outcome, which rank equal. + - The sidecar's outcome ranks **strictly above** the file's proof's → the + sidecar's verdict is the verdict, `proof_source` is `sidecar`, and it + carries *trailer copy differs* (step 1, vectors 172, 173) or *manifest + copy differs* (step 4, vectors 169, 171) instead of *sidecar differs*. + - Otherwise → the file's proof stands with *sidecar differs*, as without + this rule (vectors 18, 127, 170, 174). + + Only outcomes are ranked, never ceilings: a sidecar stripped of a `revoked` + `attestation_status` reads amber where the file's complete copy reads red, + and must not win. Nothing is gained this way that deleting the trailer or + the manifest would not give — the sidecar, over those bytes, is what a + reader finds then — and the file's copy can still lower a ceiling on a tie, + never raise one. A sidecar identical to the trailer, byte for byte, or to + the depth-0 proof, as JCS, is no second verdict and changes nothing. + Outside the rule, unchanged: a nested trailer (§3) is *nested proof*, a + structural verdict no proof of the file is judged for, and deleting the + outer trailer leaves the inner one to step 1; a footer whose CRC fails + (step 2) or whose major is not 1 (step 3) stays *corrupted proof* or + *unsupported format version* whatever the sidecar says — no proof of the + file is judged there, so there is no outcome to rank. - **Video.** Recomputing §5 content hashes stays optional and, when skipped, declared (*segment content not recomputed*); a sidecar next to a demuxable container is the case §5 has in mind. @@ -1903,11 +1921,12 @@ capture's, and where §4–§8 would give *tampered* or *frames not compared* th outcome is *no proof found*: the derivation is declared, and the proof is not presented as this file's. -**Where the proof came from.** *Sidecar differs* and *manifest copy differs* -(§3.1) are warnings on an otherwise valid verdict: a second copy of the proof -that is not the one used. A depth-0 proof from Content Credentials never makes -a verdict red over a differing sidecar that does better over the same bytes -(§3.1, step 4). `proof_source` and `frames_name_capture` (§3.2) are +**Where the proof came from.** *Sidecar differs*, *trailer copy differs* and +*manifest copy differs* (§3.1) are warnings on an otherwise valid verdict: a +second copy of the proof that is not the one used. Neither a trailer nor a +depth-0 proof from Content Credentials makes a verdict red over a differing +sidecar that does better over the same bytes (§3.1, *A sidecar that does +better*). `proof_source` and `frames_name_capture` (§3.2) are diagnostics and never labels. **The rule that outranks the table.** A watermark match with no valid signature is @@ -2060,7 +2079,8 @@ says. position source (151), the verdict hardening and presentation binding (152–164) and `media.presentation` required (165–168), and **171** in corpus 6.1.0 with a sidecar no longer overruled by a worse - depth-0 manifest proof (169–171), + depth-0 manifest proof (169–171), and **174** in corpus 6.2.0 with + the same rule for a trailer (172–174), checked by the reference verifier in `tools/`. The §7 vectors trust the anchors in `vectors/_trust/`, whose attestation root is a test root: they prove the level logic, not that an implementation can walk a diff --git a/tools/src/carrier.ts b/tools/src/carrier.ts index 2967b16..45052a1 100644 --- a/tools/src/carrier.ts +++ b/tools/src/carrier.ts @@ -214,9 +214,10 @@ export type Extraction = /** *sidecar differs*, *manifest copy differs*. */ labels: string[] /** - * §3.1 step 4: a sidecar that differs from a depth-0 proof. Judged too, - * and its verdict stands, with *manifest copy differs*, when its - * outcome ranks above the manifest proof's. + * §3.1: a sidecar that differs from the proof the file carries (a + * trailer, or a depth-0 manifest proof). Judged too, over the same + * bytes, and its verdict stands, with *trailer copy differs* or + * *manifest copy differs*, when its outcome ranks above the file's. */ alternate?: { payload: Buffer, source: ProofSource, labels: string[] } } @@ -225,7 +226,9 @@ export type Extraction = * §3.1–§3.2 precedence, from the end of the file: * * 1. a valid footer whose CRC matches: the trailer is the proof; a sidecar is - * compared byte for byte, the active manifest's copy as JCS; + * compared byte for byte, the active manifest's copy as JCS. A sidecar + * that differs is handed back as the alternate, as in step 4: a trailer + * appended to a stripped file is no more authenticated than a manifest; * 2. a valid footer whose CRC fails: *corrupted proof*, whatever else exists; * 3. `VCAP` with a major ≠ 1: *unsupported format version*; * 4. no footer: the active manifest's proof, then the sidecar, then the first @@ -240,11 +243,18 @@ export const extractProof = (file: Buffer, sidecar?: Buffer, externalStore?: Buf if (trailer.kind === 'ok') { const media = file.subarray(0, trailer.mediaEnd) if (parseTrailer(media).kind !== 'none') return { kind: 'nested' } - const labels: string[] = [] - if (sidecar && !sidecar.equals(trailer.payload)) labels.push('sidecar differs') const copy = carrierOf(media, externalStore).active - if (copy && !sameProof(copy.bytes, trailer.payload)) labels.push('manifest copy differs') - return { kind: 'proof', payload: trailer.payload, media, flags: trailer.flags, source: { kind: 'trailer' }, labels } + // The active manifest's copy is compared with whichever proof is used. + const manifestLabel = (proof: Buffer): string[] => copy && !sameProof(copy.bytes, proof) ? ['manifest copy differs'] : [] + const differs = sidecar !== undefined && !sidecar.equals(trailer.payload) + return { + kind: 'proof', payload: trailer.payload, media, flags: trailer.flags, source: { kind: 'trailer' }, + labels: [...(differs ? ['sidecar differs'] : []), ...manifestLabel(trailer.payload)], + // §3.1: a valid-CRC trailer appended to a trailer-stripped file is no + // more authenticated than a manifest; the sidecar is judged over the + // bytes the trailer's proof is judged over, as deleting the trailer would. + ...(differs ? { alternate: { payload: sidecar, source: { kind: 'sidecar' as const }, labels: ['trailer copy differs', ...manifestLabel(sidecar)] } } : {}) + } } const carrier = carrierOf(file, externalStore) const kind = 'c2pa' as const diff --git a/tools/src/generate.ts b/tools/src/generate.ts index 2d39cdb..49edc1c 100644 --- a/tools/src/generate.ts +++ b/tools/src/generate.ts @@ -264,6 +264,18 @@ file({ name: '17-jpeg-sidecar-only', ext: 'jpg', file: baseJpeg, sidecar: jcs(jp file({ name: '18-jpeg-sidecar-differs', ext: 'jpg', file: jpegSealed, sidecar: jcs(other as Json), proof: jpegProof, expected: { outcome: 'authentic', labels: [...PHOTO_LABELS, 'sidecar differs'], not_evaluated: [], core_hash: hashOf(jpegProof) }, notes: 'Trailer and sidecar both present and different. The trailer is authoritative; the sidecar is reported and not used (§3).' }) + + // §3.1: a valid-CRC trailer is no more authenticated as the file's than a + // manifest is. Appended to a trailer-stripped genuine file, another + // capture's proof does not overrule the genuine sidecar beside it. + const foreign = sign(photoCore(editPixels(baseJpeg), 'image/jpeg', { capture_id: Buffer.alloc(16, 0x72).toString('base64url') })) + file({ name: '172-jpeg-foreign-trailer-sidecar', ext: 'jpg', file: seal(baseJpeg, foreign), sidecar: jcs(jpegProof as Json), proof: jpegProof, + expected: { outcome: 'authentic', labels: [...PHOTO_LABELS, 'trailer copy differs'], not_evaluated: [], core_hash: hashOf(jpegProof), proof_source: { kind: 'sidecar' } }, + notes: 'Vector 05\'s unsealed photo — the canonical bytes of vector 01 once its trailer is stripped — with **another capture\'s** proof appended as a valid trailer (a new capture id and the hash of different pixels, validly signed, CRC correct), next to a sidecar holding vector 01\'s proof. Anyone can append such a trailer: it proves nothing about which file it was sealed with.\n\nThe trailer\'s proof alone reads *tampered* — its `media.hash` is not these bytes — and before corpus 6.2.0 that was the verdict: step 1 made the trailer the proof and a genuine file next to its genuine proof was accused. §3.1 now judges both when the sidecar differs, over the same bytes (the file without the trailer), and the sidecar\'s verdict stands when its outcome ranks strictly above the trailer\'s: **authentic**, vector 01\'s verdict, with *trailer copy differs* and `proof_source` the sidecar. Nothing is gained by it that deleting the trailer would not give (vector 17). Vector 169 is the same case with the foreign proof in a C2PA manifest; vector 174 is a sidecar that does no better; vector 18 is a tie on *authentic*, where the trailer stands.' }) + + file({ name: '174-jpeg-trailer-sidecar-no-better', ext: 'jpg', file: seal(editPixels(baseJpeg), jpegProof), sidecar: jcs(other as Json), proof: jpegProof, + expected: { outcome: 'tampered', labels: [], not_evaluated: [], core_hash: hashOf(jpegProof), proof_source: { kind: 'trailer' } }, + notes: 'Vector 11 — vector 01\'s proof sealed onto a photo whose pixels changed — next to vector 18\'s sidecar: a proof over the same pixels as vector 01 with `device_clock` one millisecond later, so it differs from the trailer byte for byte. Both proofs read *tampered* over these bytes. §3.1 lets a sidecar decide only when its outcome ranks **strictly above** the trailer\'s; this one ties, so the trailer\'s proof stands, with `proof_source` the trailer: **tampered**, vector 11\'s verdict. A red outcome carries no labels, *sidecar differs* included (§8). Vector 170 is the same tie against a manifest\'s proof.' }) } file({ name: '19-jpeg-flags-disagree', ext: 'jpg', file: seal(baseJpeg, jpegProof, { flags: Flag.PSEUDONYMOUS }), proof: jpegProof, @@ -574,6 +586,18 @@ const videoCore = (media: Buffer, extra: Proof = {}): Proof => photoCore(media, device({ name: '89-mp4-container-cut-clip', file: Buffer.concat([cut, h264.trailer]), proof: h264.proof, expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [1, 2] }, location: { claimed: 'none', level: 'none' } }, notes: 'Vector 36 **cut**: its first GOP removed from the video track, the audio frames before the cut removed with it, and the full proof — all three segments — still in the trailer. This is what a clip is: the file lacks segment 0, the proof does not.\n\nEvery surviving sample keeps its instant on the movie timeline (the movie timescale becomes 90 kHz and each track gets an empty edit for the time that was cut), so §5\'s audio rule assigns the same frames to segments 1 and 2 as in the original, and both recompute. `remux.ts` copies the decoder configuration, the track header and the track layout as they were, so the clip presents its frames as the core\'s `media.presentation` says (§5 *Presentation*). **Verified clip**, 1 and 2 of 3. Segment 0 is signed and absent, which is the clip case and never *tampered*; `media.hash` does not match, which is what says this is not the original.\n\nVector 38 removed segment 0 from the **proof** and left it in the file; under the binding rule that is a GOP no signature covers, and it reads *tampered*.' }) + + // §3.1 on a clip: another capture's video proof appended as a trailer to + // the trailer-stripped clip, the genuine proof beside it. The foreign + // proof is vector 166's core and content hashes under a new capture id, + // its core and segment chain re-signed for that id: every signature + // holds, and no GOP of the clip names its capture. + const capture = Buffer.alloc(16, 0x73) + const hashes = (h264.proof.segments as unknown as SegmentEntry[]).map((e) => Buffer.from(e.hash, 'base64url')) + const foreign = sign({ ...h264.proof, capture_id: capture.toString('base64url'), segments: signChain(capture, hashes, privateKey) as unknown as Json }) + device({ name: '173-mp4-container-foreign-trailer-sidecar', file: seal(cut, foreign), sidecar: h264.payload, proof: h264.proof, + expected: { outcome: 'verified_clip', labels: [...DEVICE_LABELS, 'trailer copy differs'], not_evaluated: [], core_hash: hashOf(h264.proof), segments: { verified: [1, 2] }, location: { claimed: 'none', level: 'none' }, proof_source: { kind: 'sidecar' }, frames_name_capture: true }, + notes: 'Vector 89\'s clip of vector 166 — GOP 0 removed — with its trailer stripped and **another capture\'s** video proof appended as a valid trailer in its place: vector 166\'s core and segment hashes under a new capture id, the core and every segment message re-signed for it. Next to it, a sidecar holding vector 166\'s proof. Every signature in the trailer\'s proof holds, and no GOP of the clip names its capture, so on its own it reads *frames not compared* (§5, *Locating segments*) — a genuine clip reduced to "nothing ties these signatures to these frames" by a trailer anyone can append.\n\n§3.1 judges both over the same bytes, the file without the trailer: the sidecar\'s proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89\'s verdict — which ranks above *frames not compared*, so it stands, with *trailer copy differs* and `proof_source` the sidecar. Vector 171 is the same case with the foreign proof in a C2PA manifest.' }) } { diff --git a/tools/src/verify.ts b/tools/src/verify.ts index ad1c20b..afd3b9d 100644 --- a/tools/src/verify.ts +++ b/tools/src/verify.ts @@ -204,10 +204,11 @@ export const verifyFile = (input: FileInput): Verdict => { const located: { frames?: boolean } = {} const verdict = { ...judge(extracted.payload, extracted.media, extracted.flags, [...extracted.labels], input, located), proof_source: extracted.source } if (located.frames !== undefined) verdict.frames_name_capture = located.frames - // §3.1 step 4: a manifest is unauthenticated — anyone can add one outside - // the canonical bytes — so a depth-0 proof that does worse over these bytes - // than a differing sidecar never decides the verdict. Whatever the sidecar - // wins here, deleting the manifest would win too; ties keep the manifest's. + // §3.1: neither a manifest nor a valid-CRC trailer is authenticated as the + // file's — anyone can add one to a stripped file — so the proof the file + // carries never decides the verdict when it does worse over these bytes + // than a differing sidecar. Whatever the sidecar wins here, deleting the + // trailer or the manifest would win too; ties keep the file's proof. if (extracted.alternate) { const alt = extracted.alternate const altLocated: { frames?: boolean } = {} @@ -232,8 +233,8 @@ export const verifyFile = (input: FileInput): Verdict => { } /** - * §3.1 step 4: how much an outcome says about the received bytes, for - * choosing between a depth-0 proof and a differing sidecar. Every other + * §3.1: how much an outcome says about the received bytes, for + * choosing between the file's proof and a differing sidecar. Every other * outcome — red, no proof, unsupported — ranks 0. */ const OUTCOME_RANK: Record = { diff --git a/vectors/172-jpeg-foreign-trailer-sidecar/NOTES.md b/vectors/172-jpeg-foreign-trailer-sidecar/NOTES.md new file mode 100644 index 0000000..da807e1 --- /dev/null +++ b/vectors/172-jpeg-foreign-trailer-sidecar/NOTES.md @@ -0,0 +1,7 @@ +# 172-jpeg-foreign-trailer-sidecar + +Vector 05's unsealed photo — the canonical bytes of vector 01 once its trailer is stripped — with **another capture's** proof appended as a valid trailer (a new capture id and the hash of different pixels, validly signed, CRC correct), next to a sidecar holding vector 01's proof. Anyone can append such a trailer: it proves nothing about which file it was sealed with. + +The trailer's proof alone reads *tampered* — its `media.hash` is not these bytes — and before corpus 6.2.0 that was the verdict: step 1 made the trailer the proof and a genuine file next to its genuine proof was accused. §3.1 now judges both when the sidecar differs, over the same bytes (the file without the trailer), and the sidecar's verdict stands when its outcome ranks strictly above the trailer's: **authentic**, vector 01's verdict, with *trailer copy differs* and `proof_source` the sidecar. Nothing is gained by it that deleting the trailer would not give (vector 17). Vector 169 is the same case with the foreign proof in a C2PA manifest; vector 174 is a sidecar that does no better; vector 18 is a tie on *authentic*, where the trailer stands. + +Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/172-jpeg-foreign-trailer-sidecar/expected.json b/vectors/172-jpeg-foreign-trailer-sidecar/expected.json new file mode 100644 index 0000000..737ac6c --- /dev/null +++ b/vectors/172-jpeg-foreign-trailer-sidecar/expected.json @@ -0,0 +1,20 @@ +{ + "kind": "file", + "outcome": "authentic", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "location declared only", + "no trusted time", + "not anchored", + "origin not hardware-attested", + "trailer copy differs", + "watermark not evaluated" + ], + "not_evaluated": [], + "core_hash": "dc59127e528a04d6e285de3abe748559e49c7f1ef66b238092a6b13afeeb5119", + "proof_source": { + "kind": "sidecar" + }, + "schema_valid": true +} diff --git a/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg b/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg new file mode 100644 index 0000000..c85529f Binary files /dev/null and b/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg differ diff --git a/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg.vcap b/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg.vcap new file mode 100644 index 0000000..fc6fd67 --- /dev/null +++ b/vectors/172-jpeg-foreign-trailer-sidecar/input.jpg.vcap @@ -0,0 +1 @@ +{"capture_id":"ABEiM0RVZneImaq7zN3u_w","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"tee"},"location":{"acc_cm":1250,"evidence":[],"lat_udeg":45464664,"level":"declared","lon_udeg":9188540},"media":{"h":16,"hash":"OAbzVz4A9m1LqjF---miCdM2Bap6wRuTWbiuW41LzRA","mime":"image/jpeg","w":16},"policy":{"pseudonymous":false},"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"qpjuFIpPNSSzyGyo1b0EFM9MdTrtruCI4myP_1RfueUcAGuOsfS78kzwJf1tUoYAz-6JzZwRuDlAYLLWrR6v9g"},"time":{"device_clock":1757332800000},"v":"vcap/1.0","watermark":{"algo":"videoseal","ecc":"bch-255-131","layout":"photo-bch-v3","payload_bits":128,"strength":8}} \ No newline at end of file diff --git a/vectors/172-jpeg-foreign-trailer-sidecar/proof.json b/vectors/172-jpeg-foreign-trailer-sidecar/proof.json new file mode 100644 index 0000000..717b6e0 --- /dev/null +++ b/vectors/172-jpeg-foreign-trailer-sidecar/proof.json @@ -0,0 +1,40 @@ +{ + "v": "vcap/1.0", + "capture_id": "ABEiM0RVZneImaq7zN3u_w", + "media": { + "mime": "image/jpeg", + "w": 16, + "h": 16, + "hash": "OAbzVz4A9m1LqjF---miCdM2Bap6wRuTWbiuW41LzRA" + }, + "device": { + "platform": "android", + "secure_hw": "tee", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "watermark": { + "algo": "videoseal", + "layout": "photo-bch-v3", + "payload_bits": 128, + "ecc": "bch-255-131", + "strength": 8 + }, + "time": { + "device_clock": 1757332800000 + }, + "location": { + "level": "declared", + "lat_udeg": 45464664, + "lon_udeg": 9188540, + "acc_cm": 1250, + "evidence": [] + }, + "policy": { + "pseudonymous": false + }, + "sig": { + "alg": "ES256", + "value": "qpjuFIpPNSSzyGyo1b0EFM9MdTrtruCI4myP_1RfueUcAGuOsfS78kzwJf1tUoYAz-6JzZwRuDlAYLLWrR6v9g", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md b/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md new file mode 100644 index 0000000..6cc9618 --- /dev/null +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/NOTES.md @@ -0,0 +1,7 @@ +# 173-mp4-container-foreign-trailer-sidecar + +Vector 89's clip of vector 166 — GOP 0 removed — with its trailer stripped and **another capture's** video proof appended as a valid trailer in its place: vector 166's core and segment hashes under a new capture id, the core and every segment message re-signed for it. Next to it, a sidecar holding vector 166's proof. Every signature in the trailer's proof holds, and no GOP of the clip names its capture, so on its own it reads *frames not compared* (§5, *Locating segments*) — a genuine clip reduced to "nothing ties these signatures to these frames" by a trailer anyone can append. + +§3.1 judges both over the same bytes, the file without the trailer: the sidecar's proof locates GOPs 1 and 2 and recomputes them, **verified clip**, 1 and 2 of 3 — vector 89's verdict — which ranks above *frames not compared*, so it stands, with *trailer copy differs* and `proof_source` the sidecar. Vector 171 is the same case with the foreign proof in a C2PA manifest. + +Derived by `tools/src/generate.ts` from the device capture in vector 36 or 37 (a Samsung SM-S908B, Android 16, StrongBox, sealed by the reference Android SDK). The container, its NAL units and its vcap SEIs are the device's; the core and the segment chain are re-signed with the test key in `tools/src/testkey.ts`, over the same capture id and the same content hashes, so that the core carries `media.presentation`, which the device proof predates (corpus 5.0.0). diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json b/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json new file mode 100644 index 0000000..1c9792b --- /dev/null +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/expected.json @@ -0,0 +1,30 @@ +{ + "kind": "container", + "outcome": "verified_clip", + "labels": [ + "integrity unevaluated", + "key not in transparency log", + "no trusted time", + "no watermark", + "not anchored", + "origin not hardware-attested", + "trailer copy differs" + ], + "not_evaluated": [], + "core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f", + "segments": { + "verified": [ + 1, + 2 + ] + }, + "location": { + "claimed": "none", + "level": "none" + }, + "proof_source": { + "kind": "sidecar" + }, + "frames_name_capture": true, + "schema_valid": true +} diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 new file mode 100644 index 0000000..f20a76f Binary files /dev/null and b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4 differ diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap new file mode 100644 index 0000000..d52b966 --- /dev/null +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/input.mp4.vcap @@ -0,0 +1 @@ +{"capture_id":"QVfcJ4u5pNCzyZIz5CuQBA","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"strongbox"},"media":{"duration_ms":3008,"h":360,"hash":"kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM","mime":"video/mp4","presentation":{"config":"X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img","display":[41943040,23592960],"matrix":[65536,0,0,0,65536,0,0,0,1073741824]},"segment_count":3,"w":640},"segments":[{"gop":0,"hash":"nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY","prev":"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","sig":"sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA"},{"gop":1,"hash":"24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8","prev":"xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc","sig":"0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg"},{"gop":2,"hash":"q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng","prev":"szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20","sig":"cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow"}],"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"},"time":{"device_clock":1788955035726},"v":"vcap/1.0"} \ No newline at end of file diff --git a/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json b/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json new file mode 100644 index 0000000..2c15cda --- /dev/null +++ b/vectors/173-mp4-container-foreign-trailer-sidecar/proof.json @@ -0,0 +1,63 @@ +{ + "v": "vcap/1.0", + "capture_id": "QVfcJ4u5pNCzyZIz5CuQBA", + "media": { + "duration_ms": 3008, + "h": 360, + "hash": "kYOCHtA4GpciHDrL1dmzMttqIVHDT5Ud2bt8Bla05mM", + "mime": "video/mp4", + "segment_count": 3, + "w": 640, + "presentation": { + "config": "X-2WMeO0pbphk8OmwNNviddrDdBAoS1ajaPZHJ67Img", + "matrix": [ + 65536, + 0, + 0, + 0, + 65536, + 0, + 0, + 0, + 1073741824 + ], + "display": [ + 41943040, + 23592960 + ] + } + }, + "device": { + "platform": "android", + "secure_hw": "strongbox", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "time": { + "device_clock": 1788955035726 + }, + "segments": [ + { + "gop": 0, + "hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY", + "prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", + "sig": "sFaGcMKsZ1ARAdKZ-DBW6aW-UO_uPKR65DH2Mns3jH1Sxa4FbB6GmC6DsT0qMgUONNZJEvNiB55Vk8iD8rzvMA" + }, + { + "gop": 1, + "hash": "24ZvcKhC3bGtKt1qMLFFVYnFG9NBVyyg9jlOmDkUbm8", + "prev": "xGL2wTPmcYVJyB7FqSLYgJam8pOmndKI01WNB0O1hWc", + "sig": "0FgvL3x2_T2F7p1aLRa8PhlbwQK-JFWQ8fM-SfYEXANMlwom3oZt4p8znWFT3NHGBlf_ZZFCfN7lLA4Rcc7zrg" + }, + { + "gop": 2, + "hash": "q7NvztavpAM84504dTtsKJG08OKNGz7Dq9-rHt6OYng", + "prev": "szKQckN8iL0fJFXROUJfIt1-4kVIz5Vo7K22PEX0u20", + "sig": "cSZQJsDlrvJfB3W6yavG0QVPDhpx-GAIXZiu9nhOaPE70uTRt60aYNm8Bk_t1VvvZyS47yO_UY2ItWE9Ca5Iow" + } + ], + "sig": { + "alg": "ES256", + "value": "bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/174-jpeg-trailer-sidecar-no-better/NOTES.md b/vectors/174-jpeg-trailer-sidecar-no-better/NOTES.md new file mode 100644 index 0000000..7d0d146 --- /dev/null +++ b/vectors/174-jpeg-trailer-sidecar-no-better/NOTES.md @@ -0,0 +1,5 @@ +# 174-jpeg-trailer-sidecar-no-better + +Vector 11 — vector 01's proof sealed onto a photo whose pixels changed — next to vector 18's sidecar: a proof over the same pixels as vector 01 with `device_clock` one millisecond later, so it differs from the trailer byte for byte. Both proofs read *tampered* over these bytes. §3.1 lets a sidecar decide only when its outcome ranks **strictly above** the trailer's; this one ties, so the trailer's proof stands, with `proof_source` the trailer: **tampered**, vector 11's verdict. A red outcome carries no labels, *sidecar differs* included (§8). Vector 170 is the same tie against a manifest's proof. + +Generated by `tools/src/generate.ts` with the test key in `tools/src/testkey.ts`. diff --git a/vectors/174-jpeg-trailer-sidecar-no-better/expected.json b/vectors/174-jpeg-trailer-sidecar-no-better/expected.json new file mode 100644 index 0000000..1a83289 --- /dev/null +++ b/vectors/174-jpeg-trailer-sidecar-no-better/expected.json @@ -0,0 +1,11 @@ +{ + "kind": "file", + "outcome": "tampered", + "labels": [], + "not_evaluated": [], + "core_hash": "dc59127e528a04d6e285de3abe748559e49c7f1ef66b238092a6b13afeeb5119", + "proof_source": { + "kind": "trailer" + }, + "schema_valid": true +} diff --git a/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg b/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg new file mode 100644 index 0000000..246188f Binary files /dev/null and b/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg differ diff --git a/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg.vcap b/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg.vcap new file mode 100644 index 0000000..6880158 --- /dev/null +++ b/vectors/174-jpeg-trailer-sidecar-no-better/input.jpg.vcap @@ -0,0 +1 @@ +{"capture_id":"ABEiM0RVZneImaq7zN3u_w","device":{"key_id":"4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM","platform":"android","secure_hw":"tee"},"location":{"acc_cm":1250,"evidence":[],"lat_udeg":45464664,"level":"declared","lon_udeg":9188540},"media":{"h":16,"hash":"OAbzVz4A9m1LqjF---miCdM2Bap6wRuTWbiuW41LzRA","mime":"image/jpeg","w":16},"policy":{"pseudonymous":false},"sig":{"alg":"ES256","pub":"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA","value":"KqGGRSq_IXHAXcQgPQbhmECAPm4_ZolK2b2daVFYHzQpWRGCTcLe0zFK28JobJEtn7ajHgCarWyOUovaorFOxQ"},"time":{"device_clock":1757332800001},"v":"vcap/1.0","watermark":{"algo":"videoseal","ecc":"bch-255-131","layout":"photo-bch-v3","payload_bits":128,"strength":8}} \ No newline at end of file diff --git a/vectors/174-jpeg-trailer-sidecar-no-better/proof.json b/vectors/174-jpeg-trailer-sidecar-no-better/proof.json new file mode 100644 index 0000000..717b6e0 --- /dev/null +++ b/vectors/174-jpeg-trailer-sidecar-no-better/proof.json @@ -0,0 +1,40 @@ +{ + "v": "vcap/1.0", + "capture_id": "ABEiM0RVZneImaq7zN3u_w", + "media": { + "mime": "image/jpeg", + "w": 16, + "h": 16, + "hash": "OAbzVz4A9m1LqjF---miCdM2Bap6wRuTWbiuW41LzRA" + }, + "device": { + "platform": "android", + "secure_hw": "tee", + "key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM" + }, + "watermark": { + "algo": "videoseal", + "layout": "photo-bch-v3", + "payload_bits": 128, + "ecc": "bch-255-131", + "strength": 8 + }, + "time": { + "device_clock": 1757332800000 + }, + "location": { + "level": "declared", + "lat_udeg": 45464664, + "lon_udeg": 9188540, + "acc_cm": 1250, + "evidence": [] + }, + "policy": { + "pseudonymous": false + }, + "sig": { + "alg": "ES256", + "value": "qpjuFIpPNSSzyGyo1b0EFM9MdTrtruCI4myP_1RfueUcAGuOsfS78kzwJf1tUoYAz-6JzZwRuDlAYLLWrR6v9g", + "pub": "MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEp2C_SxUua1GBx-6u3KBIJKPwOb6yEYmTqfdbgzJbVJCy1_wvmKAjjmvD-d5EdVWpGx0Jxcduppsd0SspNPHKyA" + } +} diff --git a/vectors/CONFORMANCE.md b/vectors/CONFORMANCE.md index d007684..48fdca3 100644 --- a/vectors/CONFORMANCE.md +++ b/vectors/CONFORMANCE.md @@ -1,6 +1,6 @@ # Claiming conformance with a vcap-spec corpus -This file says what the sentence *"conformant with vcap-spec corpus 6.1.0"* +This file says what the sentence *"conformant with vcap-spec corpus 6.2.0"* has to mean for a consumer to be able to check it, and how to produce the report that backs it. `README.md` next to it describes the vectors themselves; this one is about the claim. @@ -30,7 +30,7 @@ Two corollaries, and they are what a reviewer should check in someone else's runner: - **Pin the count, do not floor it.** `expect(count).toBeGreaterThanOrEqual(30)` - over a corpus of 171 hides the loss of 141 vectors. Compare against + over a corpus of 174 hides the loss of 144 vectors. Compare against `vector_count` in `MANIFEST.json` and fail on inequality — that also catches the corpus that is newer than the runner, which is the useful half. - **A vector you cannot run is declared, not dropped.** A runner that has no @@ -47,11 +47,11 @@ reference verifier, measured against the corpus in the same commit. ```json { "implementation": "acme-verify 3.2 (https://example.invalid/acme-verify)", - "corpus_version": "6.1.0", + "corpus_version": "6.2.0", "manifest_sha256": "…64 hex…", - "vectors_declared": 171, - "vectors_run": 171, - "passed": 171, + "vectors_declared": 174, + "vectors_run": 174, + "passed": 174, "failed": [], "not_run": [] } @@ -106,5 +106,5 @@ be read and re-implemented rather than imported. arithmetic and `vectors/_watermark/agreement-floor.json` for the 0.85 floor a `video-rep-v1` decoder must not report an id below. - **Not a claim about a newer corpus.** A minor bump adds vectors and a - major one moves some (`README.md`, *Bump policy*), so passing corpus 6.1.0 - says nothing about a later corpus, and everything about 6.1.0's. State the version you ran. + major one moves some (`README.md`, *Bump policy*), so passing corpus 6.2.0 + says nothing about a later corpus, and everything about 6.2.0's. State the version you ran. diff --git a/vectors/MANIFEST.json b/vectors/MANIFEST.json index 792b4ab..0ee81d9 100644 --- a/vectors/MANIFEST.json +++ b/vectors/MANIFEST.json @@ -1,6 +1,6 @@ { - "corpus_version": "6.1.0", - "vector_count": 171, + "corpus_version": "6.2.0", + "vector_count": 174, "vectors": [ { "name": "01-jpeg-sealed", @@ -1196,6 +1196,27 @@ "outcome": "verified_clip", "sha256": "b83b96d7c648f4a668166a10fa210e46517d3fd87f0057e9841c16adc81d2daf", "files": 5 + }, + { + "name": "172-jpeg-foreign-trailer-sidecar", + "kind": "file", + "outcome": "authentic", + "sha256": "dd0e2605acc1c03c606733d59811c7ff371fd182e68275cd29eab7bcd0cb19f0", + "files": 5 + }, + { + "name": "173-mp4-container-foreign-trailer-sidecar", + "kind": "container", + "outcome": "verified_clip", + "sha256": "b1ded8090640c4cbbb4d03531eb49fb4144f63f4982a0d882a074e3d7c0ed916", + "files": 5 + }, + { + "name": "174-jpeg-trailer-sidecar-no-better", + "kind": "file", + "outcome": "tampered", + "sha256": "a4b4815d2d12d68bc02689d32171a1d087ed4881104a0de0fe28524e19d7f7a1", + "files": 5 } ], "fixtures": { diff --git a/vectors/README.md b/vectors/README.md index 4398269..e4d80af 100644 --- a/vectors/README.md +++ b/vectors/README.md @@ -40,7 +40,7 @@ and pin `none`. `proof_source` (where the proof was read: `trailer`, `sidecar`, or `c2pa` with the carrying manifest's label and its depth on the `parentOf` chain) and `frames_name_capture` (whether a GOP of the file names the proof's capture) -appear on the carrier vectors (123–147, 169–171), and are compared where present. +appear on the carrier vectors (123–147, 169–171) and on 172–174, and are compared where present. `debug`, where present, is for humans: intermediate bytes to compare before touching signatures. @@ -146,7 +146,7 @@ The numbered corpus (`vectors/NN-*`) has its own version, in `vectors/VERSION` — separate from `vcap/1.0`, the proof format version. The format version says what a proof looks like; the corpus version says which exact vectors an implementation checked itself against, so a third party can claim "conformant -with vcap-spec corpus 6.1.0" and mean something a consumer can check. +with vcap-spec corpus 6.2.0" and mean something a consumer can check. `vectors/MANIFEST.json` is that check: for every `vectors/NN-*` directory, its `kind`, its `outcome`, and a SHA-256 over its files (name and length included, @@ -162,7 +162,7 @@ npm run manifest:check # exits 1 if the committed file is stale — CI runs th ``` `vectors/CONFORMANCE.md` says what the sentence "conformant with corpus -6.1.0" has to contain to be checkable — corpus version, manifest hash, and +6.2.0" has to contain to be checkable — corpus version, manifest hash, and how many vectors actually ran — and why a suite that ran zero vectors must be red. `vectors/conformance-report.json` is this repository's own claim in that format, regenerated and checked by CI (`npm run conformance:report` / @@ -211,7 +211,9 @@ their notes describe: 145 *verified clip* (1–2 of 3, depth 1), 146 *tampered* an active C2PA manifest), 147 *no proof found* through *Content Credentials carry the proof of a source capture*. Nothing else moved. 6.1.0 is a minor again: 169–171 added (a sidecar is no longer overruled by a depth-0 manifest -proof that does worse over the same bytes, §3.1 step 4), none changed. +proof that does worse over the same bytes, §3.1 step 4), none changed. 6.2.0 +is a minor too: 172–174 added (the same rule for a trailer, §3.1 *A sidecar +that does better*), none changed. `vectors/edge-cases/` (below) is not in the manifest and not part of the versioned corpus: it is regenerated on demand by its own tool, not hand-curated @@ -246,9 +248,9 @@ none, by design — see its file comment), so there is nothing here to hand a marred payload to. That boundary belongs to whichever component owns the decoder. -**The sidecar vectors** (17, 18, 70, 71, 72) carry `input..vcap` next to +**The sidecar vectors** (17, 18, 70, 71, 72, 172–174) carry `input..vcap` next to the input, and a verifier under test is handed both, as `tools/test/vectors.test.ts` -does. They pin §3.1: the trailer wins when it is found and intact (18), a broken +does. They pin §3.1: the trailer wins when it is found and intact and the sidecar does no better (18, 174), a sidecar that does better over the same bytes outranks an appended trailer (172, 173), a broken trailer is *corrupted* whatever the sidecar says (72), and a sidecar alone restores the full verdict over unchanged bytes (17) and nothing over changed ones (70, 71). **The C2PA co-existence vectors** (02, 03, 04, 68, 69, 73) carry diff --git a/vectors/VERSION b/vectors/VERSION index dfda3e0..6abaeb2 100644 --- a/vectors/VERSION +++ b/vectors/VERSION @@ -1 +1 @@ -6.1.0 +6.2.0 diff --git a/vectors/conformance-report.json b/vectors/conformance-report.json index 24a0287..ac0517f 100644 --- a/vectors/conformance-report.json +++ b/vectors/conformance-report.json @@ -1,26 +1,26 @@ { "implementation": "vcap-spec reference verifier (tools/src/verify.ts)", - "corpus_version": "6.1.0", - "manifest_sha256": "7ff31e1aa784cdd6855ad5b6ed5df075c853784d7f1dc22c5f2636a18ce1605d", - "vectors_declared": 171, - "vectors_run": 171, - "passed": 171, + "corpus_version": "6.2.0", + "manifest_sha256": "2ff5796392cf2b26d51700e55f409edcbd3aab4287105aaf11158a7b1f5b0e6d", + "vectors_declared": 174, + "vectors_run": 174, + "passed": 174, "failed": [], "by_kind": { - "container": 29, - "file": 133, + "container": 30, + "file": 135, "jcs": 2, "segments": 7 }, "by_expected_outcome": { - "authentic": 95, + "authentic": 96, "corrupted_proof": 3, "frames_not_compared": 6, "n/a": 2, "nested_proof": 1, "no_proof_found": 31, - "tampered": 24, + "tampered": 25, "unsupported_format_version": 2, - "verified_clip": 7 + "verified_clip": 8 } }