Repository navigation
Conversation
…claims When reading, an identity assertion's referenced assertions were checked only against its own claim. A reference to an assertion in an ingredient's claim was reported as cawg.identity.assertion.mismatch, although CAWG Identity Assertion 1.3 §5.1.1 allows references into "the C2PA claim or any ingredient's claim" and §7.1 step 2 checks both. Also, the hard-binding check only required some hard-binding reference, so cawg.identity.hard_binding_incorrect (§7.1 step 4) was never reported for a reference to a hard binding other than the claim's own. Manifest decoding now adds the assertions of ingredient claims (traced recursively, with absolute URIs) to PartialClaim, and check_against_partial_claim resolves references against them. A hard-binding reference that is not in the claim itself is reported as cawg.identity.hard_binding_incorrect (new ValidationError::IncorrectHardBindingAssertion and validation_status::CAWG_IDENTITY_HARD_BINDING_INCORRECT). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes in this pull request
1. References into ingredient claims are rejected. When reading,
SignerPayload::check_against_partial_claimchecks referenced assertions only against the identity assertion's own claim. A reference to an assertion in an ingredient's claim is therefore reported ascawg.identity.assertion.mismatch. CAWG Identity Assertion 1.3 allows these references:created_assertions,gathered_assertions… of the C2PA claim or any ingredient's claim."2.
cawg.identity.hard_binding_incorrectis never reported. The hard-binding check only requires some hard-binding reference. §5.1.1 requires the reference to be the claim's own hard binding, and to not reference any other. §7.1 step 4 reportscawg.identity.hard_binding_incorrectotherwise.Changes:
PartialClaimgets a crate-private list of ingredient-claim assertions.Manifest::from_storefills it with the assertions of the claim's ingredient claims, traced recursively, using absolute URIs (self#jumbf=/c2pa/<ingredient label>/c2pa.assertions/<label>).check_against_partial_claimresolves a reference against the claim first, then against the ingredient claims by exact URI. The hash is compared as before.cawg.identity.hard_binding_incorrect. This addsValidationError::IncorrectHardBindingAssertionandvalidation_status::CAWG_IDENTITY_HARD_BINDING_INCORRECT. Adding a variant toValidationError, which isn't#[non_exhaustive], is technically a breaking change for exhaustive matches.Not changed:
SignerPayload::check_against_manifest(used byIdentityAssertion::validate) and theReader::post_validatepath still build their partial claim from the claim alone.Tests: two new fixtures, generated with mrappard/c2pa-rs-text-support
cawg/conformance-fixtures. Both areCA.jpgwith theCA.jpgingredient and an X.509 identity assertion.identity_assertion_may_reference_ingredient_claimusesvalidation_method/references_ingredient_assertion.jpg. Its identity assertion also references the ingredient manifest'sc2pa.actions. The test checks that nocawg.*failure is reported.identity_assertion_with_ingredient_hard_bindingusesvalidation_method/hard_binding_incorrect.jpg. Its identity assertion references the ingredient manifest'sc2pa.hash.datainstead of its own. The test checks that the onlycawg.*failure iscawg.identity.hard_binding_incorrect.Both fail without the fix, and pass with OpenSSL and with
rust_native_crypto.cargo test -p c2pa --lib --features file_iopasses, and Clippy is clean.Conformance results
Found with a CAWG identity assertion conformance suite I'm building; it's not public yet.
identity_references_ingredient_assertionnow passes.identity_hard_binding_incorrectnow gets the right code. It fully passes together with fix(identity): do not report well-formed for an identity assertion that failed validation #2837, which stopscawg.identity.well-formedfrom being reported alongside the failure.Checklist
TO DOitems (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment. (No new TODO items.)🤖 Generated with Claude Code