Skip to content

Fix VerifyBlob target descriptor decoding and skipped verification handling - #601

Merged
yizha1 merged 2 commits into
notaryproject:mainfrom
rene-founder:fix/verifyblob-target-artifact-skip
Nov 25, 2026
Merged

yizha1 merged 2 commits into
notaryproject:mainfrom
rene-founder:fix/verifyblob-target-artifact-skip

Conversation

@rene-founder

Copy link
Copy Markdown
Contributor

VerifyBlob currently decodes the signed payload directly into an OCI descriptor. The descriptor is nested under targetArtifact in the Notation envelope payload, so this can return an empty descriptor despite successful verification.

Decode the content as envelope.Payload and return its TargetArtifact. Also handle the skip verification level consistently with Verify: when verification is skipped and no envelope content is available, return the zero descriptor and verification outcome without dereferencing nil. Return a controlled error if the verifier supplies no outcome or omits envelope content outside the skip case.

The tests cover the returned target descriptor, the skip path, and rejection when the requested content media type differs from the signed artifact.

Validation: the focused tests pass on Windows. go test -count=1 ./... reports four failures in notation-go/dir on this Windows host because those tests expect Unix-style paths; the other reported packages pass. No changes were made to dir/.

René Atencio Roa | Alekore Systems Inc. (rene@alekore.ai)

@cshung cshung 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.

LGTM. I reproduced the empty-descriptor bug through an instrumented CLI and confirmed that this fix returns the correct digest, size, media type, and annotations from the original signature, without re-signing.

Validated JWS and COSE signatures, unchanged rejection behavior for invalid inputs and untrusted certificates, and correct handling of explicit skip. Existing OCI verification remained unchanged. Both CLI and SDK race-enabled regression suites passed.

No blocking findings. Approve.

yizha1
yizha1 previously approved these changes Nov 23, 2026

@yizha1 yizha1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@codecov

codecov Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.88889% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 82.80%. Comparing base (a48f228) to head (6e875d5).

Files with missing lines Patch % Lines
notation.go 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #601      +/-   ##
==========================================
+ Coverage   82.76%   82.80%   +0.03%     
==========================================
  Files          36       36              
  Lines        2629     2635       +6     
==========================================
+ Hits         2176     2182       +6     
  Misses        311      311              
  Partials      142      142              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cshung cshung 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.

Suggested tests for the patch-coverage gate. No production changes.

Comment thread verify_blob_test.go Resolved

@cshung cshung 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.

Thanks for adding the verifier-outcome tests. I pulled this revision and ran the complete race-enabled make test suite; it passes. The generated coverage profile shows 8 of 9 changed executable lines fully covered (88.89%), above the 80% patch target. Both new defensive error paths are now exercised, and no production code changed since the earlier review.

No blocking findings. GitHub Actions is currently awaiting maintainer approval, so this is independent local validation rather than a fresh Codecov result.

@yizha1 yizha1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks @rene-founder

@yizha1

yizha1 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

@rene-founder
rene-founder force-pushed the fix/verifyblob-target-artifact-skip branch from 985fbe3 to 6e875d5 Compare November 25, 2026 04:32
@rene-founder

Copy link
Copy Markdown
Contributor Author

Hi @yizha1, thanks for the heads-up. I have signed the commits on this branch (both commits now show Verified alongside the DCO sign-off, with no code changes from the tested tree).

René Atencio Roa
Founder, Alekore Systems Inc.

Signed-off-by: René Atencio Roa <rene@alekore.ai>
Signed-off-by: René Atencio Roa <rene@alekore.ai>
@yizha1
yizha1 merged commit 3babf25 into notaryproject:main Nov 25, 2026
9 checks passed
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