diff options
Diffstat (limited to 'crypto/signature_nocgo.go')
-rw-r--r-- | crypto/signature_nocgo.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/signature_nocgo.go b/crypto/signature_nocgo.go index 78b99c02b..f636b2377 100644 --- a/crypto/signature_nocgo.go +++ b/crypto/signature_nocgo.go @@ -87,6 +87,10 @@ func VerifySignature(pubkey, hash, signature []byte) bool { if err != nil { return false } + // Reject malleable signatures. libsecp256k1 does this check but btcec doesn't. + if sig.S.Cmp(secp256k1_halfN) > 0 { + return false + } return sig.Verify(hash, key) } |