Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,30 @@ else.

## Unreleased

### C2PA video vectors rebuilt over a presentation-bound core — corpus 5.0.0 → **6.0.0**

**Breaking** for the corpus, not the format: no spec text changes. A major
bump because published vector bytes moved (`vectors/README.md`, *Bump
policy*). Corpus 6.0.0 (168 vectors).

- **Moved bytes, verdicts restored**: 145, 146 and 147, minted again by
`make-c2pa-vectors.ts --only 145,146,147` from vector 166 — vector 36's
container under the re-signed core that carries `media.presentation` —
instead of 36's device proof, which lacks it. 145 *no proof found* →
**verified clip** (1–2 of 3, proof at depth 1); 146 *no proof found* →
**tampered** (segment 1 verified, proof at depth 0: again the only video
case of a tampered proof inside an active C2PA manifest); 147 stays **no
proof found**, now for its original reason, *Content Credentials carry the
proof of a source capture* (§3.2), with `core_hash` and
`frames_name_capture` back. All three are `schema_valid` true. New salts
(c2pa-rs draws them at random), new notes; the 5.0.0 errata for 145–147 are
replaced by one entry. c2pa-rs's `c2pa` block is unchanged; the notes
record c2patool 0.27.16.

**What a verifier that predates 6.0.0 does**: a 5.0.0 verifier reads the three
files correctly — the rules did not change — and fails only the pinned
manifest digest; one that predates 5.0.0 fails their `core_hash`.

### `media.presentation` required — corpus 4.0.0 → **5.0.0**

**Breaking.** §5 *Presentation*, §6.1, §8: `media.presentation` is a
Expand Down
31 changes: 17 additions & 14 deletions tools/src/make-c2pa-vectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,11 @@ const baseMp4 = readFileSync(join(VECTORS, '_media', 'base.mp4'))
const photo = proofOf('01-jpeg-sealed')
const sealedJpeg = readVector('01-jpeg-sealed', 'input.jpg')
const timestamped = proofOf('59-jpeg-timestamped')
const device = readVector('36-mp4-container-verified', 'input.mp4')
// Vector 166: vector 36's device container under the re-signed core that
// carries media.presentation (corpus 5.0.0). The device proof of 36 predates
// that required field, so a clip of it would read no proof found and test
// nothing else. 89 is the cut of the same container under the same core.
const device = readVector('166-mp4-container-h264-presentation', 'input.mp4')
const deviceProof = JSON.parse((parseTrailer(device) as { payload: Buffer }).payload.toString('utf8')) as Proof
const cutClip = unsealed(readVector('89-mp4-container-cut-clip', 'input.mp4'))

Expand Down Expand Up @@ -515,20 +519,19 @@ const withStore = await c2paSign({ asset: baseJpeg, mime: 'image/jpeg', label: l
// ---- ISO-BMFF: a clip, and the `parentOf` chain (§3.2) -------------------------

{
// Generation 0: the Android capture of vector 36, sealed, after a C2PA claim
// generator wrote a manifest carrying its proof. On ISO-BMFF that manifest
// sits inside media.hash, so this file itself reads tampered (vector 73) —
// it is an ingredient here, not a vector.
// Generation 0: vector 166 — the Android capture of vector 36 under a core
// that carries media.presentation — after a C2PA claim generator wrote a
// manifest carrying its proof. On ISO-BMFF that manifest sits inside
// media.hash, so this file itself reads tampered (vector 73) — it is an
// ingredient here, not a vector.
const g0 = await c2paSign({ asset: device, mime: 'video/mp4', label: label(145, 0), proof: deviceProof })
const clipOf = async (n: number, asset: Buffer, actions: string[], o: { parent?: Buffer, proof?: Proof } = {}): Promise<Buffer> =>
(await c2paSign({ asset, mime: 'video/mp4', label: label(n, 1), parent: { asset: o.parent ?? g0.file, mime: 'video/mp4' }, actions, proof: o.proof })).file
const provenance = 'The source is the Android capture of vector 36 (Samsung SM-S908B, StrongBox, device signatures untouched); the clip bytes are vector 89\'s cut.'
const provenance = 'The source is vector 166: the container of vector 36\'s Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device\'s, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89\'s cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36\'s device proof, which predates the field and read *no proof found*.'

add({ name: '145-mp4-c2pa-clip-parent-of', ext: 'mp4', kind: 'container', file: await clipOf(145, cutClip, ['c2pa.trimmed']), proof: deviceProof,
// Corpus 5.0.0: vector 36's proof has no `media.presentation`, a required
// core field (§6.1), so the proof is not well formed wherever it is found.
expected: { ...NOT_FOUND, proof_source: src(1, label(145, 0)) }, schemaValid: false,
notes: `A clip made by a C2PA-aware cutter: vector 89's cut of vector 36 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as \`parentOf\` and records \`c2pa.trimmed\`. The source's manifest (generation 0, ${label(145, 0)}) carries vector 36's proof and travels in the clip's store as its ingredient.\n\nNo footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. Since corpus 5.0.0 that proof is **no proof found** before any GOP is read: vector 36's core predates \`media.presentation\`, which every proof carrying \`segments\` requires (§6.1). ${provenance}` })
expected: { outcome: 'verified_clip', labels: DEVICE_LABELS, not_evaluated: [], core_hash: hashOf(deviceProof), segments: { verified: [1, 2] }, proof_source: src(1, label(145, 0)), frames_name_capture: true },
notes: `A clip made by a C2PA-aware cutter: vector 89's cut of vector 166 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as \`parentOf\` and records \`c2pa.trimmed\`. The source's manifest (generation 0, ${label(145, 0)}) carries vector 166's proof and travels in the clip's store as its ingredient.\n\nNo footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (\`frames_name_capture\`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation the clip still has (§5 *Presentation*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. ${provenance}` })

{
// One byte of the last GOP's IDR slice data changed, then signed by a
Expand All @@ -544,13 +547,13 @@ const withStore = await c2paSign({ asset: baseJpeg, mime: 'image/jpeg', label: l
const at = idr.offset + idr.size - 16
edited[at] = (edited[at] as number) ^ 0x55
add({ name: '146-mp4-c2pa-clip-gop-replaced', ext: 'mp4', kind: 'container', file: await clipOf(146, edited, ['c2pa.trimmed'], { parent: device, proof: deviceProof }), proof: deviceProof,
expected: { ...NOT_FOUND, proof_source: src(0, label(146, 1)) }, schemaValid: false,
notes: `Vector 145's clip with one byte of the last GOP's IDR slice data changed (clip byte ${at}), signed by a cutter that opens vector 36 as \`parentOf\` and carries its proof in **its own** manifest, as the clip's: a GOP whose vcap SEI still names the capture and segment 2, and whose bytes are not the ones segment 2 signs. The cutter's manifest is valid — it vouches for the bytes it saw — and declares a trim, not this.\n\nSince corpus 5.0.0 the outcome is **no proof found**, at depth 0 as anywhere: vector 36's core predates \`media.presentation\`, which every proof carrying \`segments\` requires (§6.1), so the proof is not well formed and no GOP is read. Before, depth 0 read like a sidecar (§5) and the located segment that does not recompute made the file *tampered*, with segment 1 verified. ${provenance}` })
expected: { outcome: 'tampered', labels: [], not_evaluated: [], core_hash: hashOf(deviceProof), segments: { verified: [1] }, proof_source: src(0, label(146, 1)), frames_name_capture: true },
notes: `Vector 145's clip with one byte of the last GOP's IDR slice data changed (clip byte ${at}), signed by a cutter that opens vector 166 as \`parentOf\` and carries its proof in **its own** manifest, as the clip's: a GOP whose vcap SEI still names the capture and segment 2, and whose bytes are not the ones segment 2 signs. The cutter's manifest is valid — it vouches for the bytes it saw — and declares a trim, not this.\n\nDepth 0 reads like a sidecar (§3.2): §5 applies, a located segment that does not recompute is **tampered**, with segment 1 verified. The corpus's only video case of a tampered proof inside an active C2PA manifest; vector 128 is the JPEG one. Vector 147 is the other side of the rule: at depth ≥ 1 a failure reads *no proof found*, because a proof found up the chain is the source's and is never held against a derivation. ${provenance}` })
}

add({ name: '147-mp4-c2pa-clip-reencoded', ext: 'mp4', kind: 'container', file: await clipOf(147, baseMp4, ['c2pa.transcoded']), proof: deviceProof,
expected: { ...NOT_FOUND, proof_source: src(1, label(145, 0)) }, schemaValid: false,
notes: `What a re-encoding editor leaves: new frames with no vcap SEI (the two-frame MP4 of \`_media/\` stands in for them), signed with a manifest that opens the capture of vector 36 as \`parentOf\` and records \`c2pa.transcoded\`. The proof is found at depth 1, and since corpus 5.0.0 it is **no proof found** before any GOP is read: vector 36's core predates \`media.presentation\`, which every proof carrying \`segments\` requires (§6.1). Before, no GOP named the capture and \`media.hash\` did not match, and at depth ≥ 1 that read *no proof found* too, reason *Content Credentials carry the proof of a source capture* (§3.2) — never *tampered*. A detector may still add *origin traced* from the watermark. ${provenance}` })
expected: { ...NOT_FOUND, core_hash: hashOf(deviceProof), proof_source: src(1, label(145, 0)), frames_name_capture: false },
notes: `What a re-encoding editor leaves: new frames with no vcap SEI (the two-frame MP4 of \`_media/\` stands in for them), signed with a manifest that opens vector 166's capture as \`parentOf\` and records \`c2pa.transcoded\`. The proof is found at depth 1 and is well formed; no GOP names the capture (\`frames_name_capture\` false) and \`media.hash\` does not match. §5 alone would say *frames not compared*; at depth ≥ 1 that becomes **no proof found**, reason *Content Credentials carry the proof of a source capture* (§3.2) — never *tampered*. A detector may still add *origin traced* from the watermark. ${provenance}` })
}

// ---- helpers used above --------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions vectors/145-mp4-c2pa-clip-parent-of/NOTES.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# 145-mp4-c2pa-clip-parent-of

A clip made by a C2PA-aware cutter: vector 89's cut of vector 36 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as `parentOf` and records `c2pa.trimmed`. The source's manifest (generation 0, urn:c2pa:76636170-0000-4000-8000-000001450000) carries vector 36's proof and travels in the clip's store as its ingredient.
A clip made by a C2PA-aware cutter: vector 89's cut of vector 166 — GOP 0 removed, no re-encoding, the vcap SEIs intact — with no trailer, signed with a manifest that opens the source as `parentOf` and records `c2pa.trimmed`. The source's manifest (generation 0, urn:c2pa:76636170-0000-4000-8000-000001450000) carries vector 166's proof and travels in the clip's store as its ingredient.

No footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (`frames_name_capture`, a locating hint), GOPs 1 and 2 are located and recompute under §5, and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. The source is the Android capture of vector 36 (Samsung SM-S908B, StrongBox, device signatures untouched); the clip bytes are vector 89's cut.
No footer, no proof at depth 0, no sidecar: the proof is found at depth 1 (§3.2), the nearest ancestor that carries one. The frames name the capture (`frames_name_capture`, a locating hint), GOPs 1 and 2 are located and recompute under §5, the core binds the presentation the clip still has (§5 *Presentation*), and the outcome is **verified clip**, 1 and 2 of 3 — vector 89's verdict, reached without a trailer. The source is vector 166: the container of vector 36's Android capture (Samsung SM-S908B), its NAL units and vcap SEIs the device's, under a core and segment chain re-signed with the test key so that it carries `media.presentation` (corpus 5.0.0); the clip bytes are vector 89's cut of it, under the same core. Rebuilt in corpus 6.0.0: the 5.0.0 files carried vector 36's device proof, which predates the field and read *no proof found*.

## C2PA

- `expected.json` `c2pa`: what c2pa-rs 0.91.0 (c2pa-node 0.9.8), trust anchor _trust/c2pa-test/root.pem reports. Informative: no vcap verdict reads it.
- c2patool 0.28.0 (trust anchor `_trust/c2pa-test/root.pem`): **Trusted**; success: `assertion.bmffHash.match`, `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: `assertion.bmffHash.additionalExclusionsPresent`, `signingCredential.ocsp.skipped`; failure: none.
- c2patool 0.27.16 (trust anchor `_trust/c2pa-test/root.pem`): **Trusted**; success: `assertion.bmffHash.match`, `assertion.hashedURI.match`, `claimSignature.insideValidity`, `claimSignature.validated`, `signingCredential.trusted`; informational: none; failure: none.

Minted by `tools/src/make-c2pa-vectors.ts` with the test key in `tools/src/testkey.ts` and the C2PA test signer in `vectors/_trust/c2pa-test/`. Committed, not regenerated: c2pa-rs salts every assertion at random (`vectors/README.md`).
21 changes: 18 additions & 3 deletions vectors/145-mp4-c2pa-clip-parent-of/expected.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
{
"kind": "container",
"outcome": "no_proof_found",
"labels": [],
"outcome": "verified_clip",
"labels": [
"integrity unevaluated",
"key not in transparency log",
"no trusted time",
"no watermark",
"not anchored",
"origin not hardware-attested"
],
"not_evaluated": [],
"core_hash": "99051d03e77c36e61cf13cd04ca64254667c0d77d45e791c6245446e1c2b928f",
"segments": {
"verified": [
1,
2
]
},
"proof_source": {
"kind": "c2pa",
"manifest": "urn:c2pa:76636170-0000-4000-8000-000001450000",
"depth": 1
},
"schema_valid": false,
"frames_name_capture": true,
"schema_valid": true,
"writer": {
"expect": "not_covered",
"reason": "the proof travels in a C2PA manifest, which no vcap writer produces"
Expand Down
Binary file modified vectors/145-mp4-c2pa-clip-parent-of/input.mp4
Binary file not shown.
30 changes: 24 additions & 6 deletions vectors/145-mp4-c2pa-clip-parent-of/proof.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"capture_id": "QVfcJ4u5pNCzyZIz5CuQBA",
"device": {
"key_id": "d5nLJJ7vt3hd8HnX2YsQllHxSfiIEDqJtmaUk3kXs5M",
"key_id": "4aF24UJH_AHu_CuygIW3PB-AMEWVoQy3iaeBh4yDSBM",
"platform": "android",
"secure_hw": "strongbox"
},
Expand All @@ -10,6 +10,24 @@
"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
},
Expand All @@ -18,25 +36,25 @@
"gop": 0,
"hash": "nufBd3tPP5n8-78zzfBnBY_5F_uJusHynSuE-PQ7snY",
"prev": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"sig": "33RRgCivH4ZAQ7MrOkqo3GcryWuleCmQFsAMIndrso5Amof5YP0GOm0e6IZTg_o3b1So8ePP_1fewa6s6N9fGg"
"sig": "sFaG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bLIVLmHfclMqK4Ve6v4Vywu4BO8ulcvl8sPuoYnsOvotexp3HB8YJ9I4od3YRCBRWFQLZCo60McWzLqdHD1_4g"
},
"time": {
"device_clock": 1788955035726
Expand Down
Loading
Loading