From 3de8696768667ebf3b3be49ee7905e7362fb9216 Mon Sep 17 00:00:00 2001 From: Piotr Dyraga Date: Mon, 28 Dec 2020 14:25:29 +0100 Subject: [PATCH] More specific error messages in local Signer implementation --- pkg/chain/local/signer.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/chain/local/signer.go b/pkg/chain/local/signer.go index 37f7210..53f7a78 100644 --- a/pkg/chain/local/signer.go +++ b/pkg/chain/local/signer.go @@ -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) @@ -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