fix(rsky-repo): verify commit signatures with digest semantics on both curves - #247
Open
afbase wants to merge 1 commit into
Open
fix(rsky-repo): verify commit signatures with digest semantics on both curves#247afbase wants to merge 1 commit into
afbase wants to merge 1 commit into
Conversation
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
force-pushed
the
fix/p256-commit-signature-verification
branch
from
September 2, 2026 23:57
523c956 to
0cb9aac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rsky-crypto exposes two verification entrypoints whose
dataargument means different things per curve:verify_signaturetreats it as a digest on secp256k1 but hashes it internally on p256, whileverify_signature_digestgives both curves digest semantics.verify_commit_sigcomputes a sha256 digest and called the former, so ES256 commit signatures were checked against a double hash and never verified. It failed closed, returningOk(false)rather than an error, so it read as a bad signature. The secp256k1 path is unchanged.Test plan:
cargo test -p rsky-repopasses, including the existing secp256k1 commit testsverify_signaturecargo build --release -p rsky-reposucceeds