Skip to content

Commit

Permalink
erong key size error handled
Browse files Browse the repository at this point in the history
  • Loading branch information
kavirajkv committed Feb 23, 2025
1 parent e6db5f0 commit 6eda237
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sign/ecdsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"crypto/ed25519"
"crypto/rand"
"encoding/hex"
"errors"
)

// To generate key value pairs using ed25519
Expand Down Expand Up @@ -60,6 +61,11 @@ func Verifysign(publickey string, digest string, sign string) (bool,error) {
return false,err
}

if len(public_key)<32 || len(public_key)>32{
err:=errors.New("Wrong key size")
return false,err
}

message_digest, err:= hex.DecodeString(digest)
if err!=nil{
return false,err
Expand Down

0 comments on commit 6eda237

Please sign in to comment.