From 3f306f63d48f011a527e301e3bf9aec2d6efb7e1 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Sun, 5 Apr 2015 19:31:18 +0200 Subject: Forward and log EC recover err and remove dup pubkey len check --- whisper/message.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'whisper') diff --git a/whisper/message.go b/whisper/message.go index 5d9e5b5c1..407cfb1e8 100644 --- a/whisper/message.go +++ b/whisper/message.go @@ -5,6 +5,7 @@ import ( "time" "github.com/ethereum/go-ethereum/crypto" + "github.com/ethereum/go-ethereum/logger/glog" ) type Message struct { @@ -32,7 +33,12 @@ func (self *Message) sign(key *ecdsa.PrivateKey) (err error) { func (self *Message) Recover() *ecdsa.PublicKey { defer func() { recover() }() // in case of invalid sig - return crypto.SigToPub(self.hash(), self.Signature) + pub, err := crypto.SigToPub(self.hash(), self.Signature) + if err != nil { + glog.V(0).Infof("Could not get pubkey from signature: ", err) + return nil + } + return pub } func (self *Message) Encrypt(to *ecdsa.PublicKey) (err error) { -- cgit v1.2.3