Skip to content

fix: do not mask descriptor mismatch with user metadata error - #610

Open
xgbtxy wants to merge 1 commit into
notaryproject:mainfrom
xgbtxy:fix/verify-integrity-error-not-masked
Open

xgbtxy wants to merge 1 commit into
notaryproject:mainfrom
xgbtxy:fix/verify-integrity-error-not-masked

Conversation

@xgbtxy

@xgbtxy xgbtxy commented Dec 5, 2026

Copy link
Copy Markdown

Problem: in Verify and VerifyBlob, when the target artifact check fails (content descriptor mismatch / integrity check failed) and UserMetadata is also supplied but not matched, the metadata error silently overwrites outcome.Error. The caller then sees only a metadata error and the fundamental failure (the signature does not cover the artifact being verified) is masked.

Fix: only evaluate UserMetadata when the artifact check passed, so the integrity failure is reported.

Tests: new subtest in TestVerifyBlob_Error fails before the fix (returns 'unable to find specified metadata in the signature') and passes after; go test -race ./verifier/ passes.

Note: this is an error-reporting fix, no API change.

Verify and VerifyBlob overwrote the integrity/descriptor mismatch error with the user metadata check error when both failed, hiding the more fundamental failure that the signature does not cover the artifact. Only check user metadata when the target artifact check passed.

Signed-off-by: Yan Chen <yan8925298@gmail.com>
Copilot AI balanced review requested due to automatic review settings December 5, 2026 17:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants