mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2025-05-09 13:13:13 +00:00
keys: don't panic if signature has invalid size
This commit is contained in:
parent
9733a6f394
commit
0a596e1df2
2 changed files with 4 additions and 1 deletions
|
@ -333,7 +333,7 @@ func (p *PublicKey) Address() string {
|
|||
// Verify returns true if the signature is valid and corresponds
|
||||
// to the hash and public key.
|
||||
func (p *PublicKey) Verify(signature []byte, hash []byte) bool {
|
||||
if p.X == nil || p.Y == nil {
|
||||
if p.X == nil || p.Y == nil || len(signature) != 64 {
|
||||
return false
|
||||
}
|
||||
rBytes := new(big.Int).SetBytes(signature[0:32])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue