Skip to content

fix(client): verify Ed25519ph signatures from dirctl sign - #2243

Merged
akijakya merged 1 commit into
mainfrom
fix/dirctl-verify
Oct 1, 2026
Merged

akijakya merged 1 commit into
mainfrom
fix/dirctl-verify

Conversation

@akijakya

Copy link
Copy Markdown
Member

dirctl sign --key with an Ed25519 key produces an Ed25519ph signature (cosign's default load options), but verifySignatureWithKey loaded a pure Ed25519 verifier, so those signatures never verified. When an Ed25519 key's signature fails the pure check, verification now retries with an Ed25519ph verifier. The pure check stays first so Ed25519 signatures from other tools still verify; ECDSA and RSA are unchanged.

Adds client/utils/cosign/verify_test.go with a sign/verify round trip for ECDSA P-256 and Ed25519 (including wrong-key and wrong-payload rejection) and a pure Ed25519 compatibility case. The Ed25519 round trip fails without the fix.

Fixes #2231

@akijakya
akijakya requested a review from a team as a code owner September 30, 2026 15:14
@github-actions github-actions Bot added the size/S Denotes a PR that changes 50-199 lines label Sep 30, 2026
@akijakya
akijakya requested a balanced review from Copilot September 30, 2026 15:43

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 review overview

🟢 Approval recommended

The focused fallback correctly addresses the signing mismatch and is covered by positive, negative, and compatibility tests.

Review effort: Balanced
Findings: None

What changed in this PR

Adds Ed25519ph verification compatibility while preserving pure Ed25519 support.

Changes:

  • Retries failed Ed25519 verification using an Ed25519ph verifier.
  • Adds round-trip, rejection, and compatibility tests.
File Description
client/​utils/​cosign/​verify.go Adds Ed25519ph fallback verification.
client/​utils/​cosign/​verify_test.go Tests key-signing verification behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ramizpolic ramizpolic left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@akijakya
akijakya enabled auto-merge (squash) October 1, 2026 07:27
@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
client/utils/cosign/verify.go 83.3% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@akijakya
akijakya merged commit 1cbd524 into main Oct 1, 2026
70 of 73 checks passed
@akijakya
akijakya deleted the fix/dirctl-verify branch October 1, 2026 07:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Denotes a PR that changes 50-199 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dirctl verify never accepts Ed25519 signatures made by dirctl sign --key

4 participants