Skip to content

fix(rsky-repo): verify commit signatures with digest semantics on both curves - #247

Open
afbase wants to merge 1 commit into
mainfrom
fix/p256-commit-signature-verification
Open

fix(rsky-repo): verify commit signatures with digest semantics on both curves#247
afbase wants to merge 1 commit into
mainfrom
fix/p256-commit-signature-verification

Conversation

@afbase

@afbase afbase commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

rsky-crypto exposes two verification entrypoints whose data argument means different things per curve: verify_signature treats it as a digest on secp256k1 but hashes it internally on p256, while verify_signature_digest gives both curves digest semantics. verify_commit_sig computes a sha256 digest and called the former, so ES256 commit signatures were checked against a double hash and never verified. It failed closed, returning Ok(false) rather than an error, so it read as a bad signature. The secp256k1 path is unchanged.

Test plan:

  • cargo test -p rsky-repo passes, including the existing secp256k1 commit tests
  • the new p256 test fails when the call is reverted to verify_signature
  • cargo build --release -p rsky-repo succeeds

@afbase afbase added the PDS Related to the PDS label Sep 2, 2026
@afbase

afbase commented Sep 2, 2026

Copy link
Copy Markdown
Contributor Author

needs review. will assess later

…h curves

verify_commit_sig computes a sha256 digest and passed it to
rsky_crypto::verify::verify_signature, whose p256 plugin hashes its input
again. ES256 commit signatures were therefore checked against
SHA256(SHA256(bytes)) and never verified, returning Ok(false) rather than an
error. verify_signature_digest gives both curves digest semantics; the
secp256k1 path is unchanged.
@afbase
afbase force-pushed the fix/p256-commit-signature-verification branch from 523c956 to 0cb9aac Compare September 2, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PDS Related to the PDS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant