Skip to content

Commit

Permalink
More specific error messages in local Signer implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
pdyraga committed Dec 28, 2020
1 parent 36e4179 commit 3de8696
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/chain/local/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (ls *Signer) VerifyWithPublicKey(
ls.operatorKey.Curve,
)
if err != nil {
return false, err
return false, fmt.Errorf("failed to unmarshal public key: [%v]", err)
}

return verifySignature(message, signature, unmarshalledPubKey)
Expand All @@ -79,7 +79,7 @@ func verifySignature(
sig := &ecdsaSignature{}
_, err := asn1.Unmarshal(signature, sig)
if err != nil {
return false, err
return false, fmt.Errorf("failed to unmarshal signature: [%v]", err)
}

return ecdsa.Verify(publicKey, hash[:], sig.R, sig.S), nil
Expand Down

0 comments on commit 3de8696

Please sign in to comment.