Repository navigation
feat: Reader offset-aware fragment verification; prepare 0.37.13.dev1 - #5
Merged
mstattma merged 3 commits intoOct 15, 2026
Merged
Conversation
…gment_at_offset) Bind the Castlabs native c2pa_reader_with_fragment_at_offset(reader, format, stream, fragment, uint64 offset) and the c2pa_reader_fragment_at_offset_supported probe as optional symbols, so older native libraries still import. - has_fragment_at_offset(): true only when both exports exist and the probe returns true. The probe is called lazily on first use, never at import. - Reader.from_fragment_at_offset(format, init_stream, fragment_stream, fragment_offset, context=None) and Reader.with_fragment_at_offset(format, stream, fragment_stream, fragment_offset). They follow with_fragment ownership: the native call consumes the reader on success and failure. Gating raises C2paError.NotSupported before any argument or native work. The format must be a non-empty str (native fragment loading cannot auto-detect). The offset must be an int in 0..2**64-1 (bool rejected). The streams must be stream-like and distinct objects, and the context valid; all of this is checked before any native call. A wrong cut or offset gives an Invalid reader with assertion.bmffHash.mismatch. - Tests: scripted gating, validation and marshalling, plus real-native checks. Those sign the per-fragment-sidx single-file fixture (copied from castlabs/c2pa-rs ec9ac2f6), cut it at merkle uuid boundaries, verify each segment Trusted with bmffHash.match, and check wrong offsets (0, +/-1, sibling) are a mismatch. The real-native tests skip when the API is absent and fail under C2PA_FRAGMENT_OFFSET_REQUIRED=1. - Docs: README, usage and release notes.
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.
For signer 1.0.8.
d4782fabinds nativec2pa_reader_with_fragment_at_offset/c2pa_reader_fragment_at_offset_supported(feat: 1.0.8 native line (dependency advisories, default EKUs, offset-aware fMP4 fragments + FFI) c2pa-rs#20): optional symbols, lazily cachedhas_fragment_at_offset(),Reader.from_fragment_at_offset(format, init_stream, fragment_stream, fragment_offset, context=None)andReader.with_fragment_at_offset(...). 65 new tests (58 scripted, 7 real-native); trusted VSI paired 207 pass; regressions clean in cbor2 5.9 and 6.1.2. Independent review: no findings.fb08982release prep forcastlabs-v0.37.13.dev1on native3328b2b4(SDK 0.92.0-dev, toolchain 1.96.0, Cargo.lockf7022b3e…, release branchfeat/trusted-vsi-functional); release smoke requires the fragment-offset capability; paired workflow moves to the same native.Merge (true merge) before tagging
castlabs-v0.37.13.dev1.