aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorGustav Simonsson <gustav.simonsson@gmail.com>2015-04-06 01:31:18 +0800
committerGustav Simonsson <gustav.simonsson@gmail.com>2015-04-07 18:48:19 +0800
commit3f306f63d48f011a527e301e3bf9aec2d6efb7e1 (patch)
tree527dc3f1c6a0ededd135c4fe7236454a3a300308 /whisper
parent7c583f82228fb373dd6bbe15effb68cf5aac0ad9 (diff)
downloadgo-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.gz
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.bz2
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.lz
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.xz
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.tar.zst
go-tangerine-3f306f63d48f011a527e301e3bf9aec2d6efb7e1.zip
Forward and log EC recover err and remove dup pubkey len check
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message.go8
1 files changed, 7 insertions, 1 deletions
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) {