Skip to content

crypto: add hash length check in nocgo VerifySignature#2702

Merged
ucwong merged 1 commit into
masterfrom
cola06
May 13, 2026
Merged

crypto: add hash length check in nocgo VerifySignature#2702
ucwong merged 1 commit into
masterfrom
cola06

Conversation

@ucwong
Copy link
Copy Markdown
Member

@ucwong ucwong commented May 13, 2026

No description provided.

I was tracing a signature verification issue in a nocgo build and found
that `VerifySignature` doesn't validate hash length. #33104 added the
check to `Sign` and `sigToPub` but missed this one. The cgo path in
`secp256k1/secp256.go` already rejects non-32-byte hashes, so the nocgo
path should do the same — otherwise a wrong-length hash gets passed to
decred's `Verify` and silently gives a bogus result.
@ucwong ucwong marked this pull request as ready for review May 13, 2026 07:24
@ucwong ucwong merged commit bd02f3c into master May 13, 2026
1 check 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.

2 participants