fix: error with validation results on invalid manifest after verify after sign#2147
fix: error with validation results on invalid manifest after verify after sign#2147ok-nick wants to merge 24 commits into
Conversation
…ing hashes for c2pa manifests
Merging this PR will improve performance by 25.45%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Memory | update-manifests/read |
5.6 MB | 4.5 MB | +25.45% |
Tip
Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.
Comparing ok-nick/verify-after-sign (21488ba) with main (a48f1cc)
Footnotes
-
64 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
…lidation if c2pa on verify after sign
96774db to
ebcd9ba
Compare
…beddable validation logic from builder to store
|
I kept |
…id, then default verify after sign to true for tests
gpeacock
left a comment
There was a problem hiding this comment.
This isn't a fix, this is an entirely new way of reporting errors.
I can see how we may want to validate the manifest when we have no asset, but that should report an invalid hash if the manifest is associated with an asset ( and it should always be, except for archives.
| asset_data: Option<&mut ClaimAssetData<'_>>, | ||
| context: &Context, | ||
| ))] | ||
| pub(crate) fn validate_manifest( |
There was a problem hiding this comment.
How is this used? Should callers never call verify_store directly? Could this have just been done in verify_store?
Fixes verify after sign so that it builds up the validation results and returns them in an err if deemed an invalid manifest. It also adds the verify after sign check to the other signing paths, including the embeddable APIs.
The PR introduces a new
ValidationFailureSummaryso that on error, it will display a concise summary of what failures, on what ingredients occurred. This can also be obtained viaValidationResults::failure_summaryfor the general case.ValidationResultsalso now implsDisplaywith a more user-friendly interface.Also adds a new setting
verify_after_sign_hashwhich rehashes the asset and validates against the hard binding assertion stored. By default this setting is false due to the performance implications. I'm keepingverify_after_signdefault to false for now, let's get the fix out first.verify_after_signsetting #1875application/c2pawill attempt to validate hash bindings #1704