aboutsummaryrefslogtreecommitdiffstats
path: root/whisper
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2015-04-08 02:48:56 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2015-04-08 02:48:56 +0800
commit758205b187e079080193c2fed2a21caff2377329 (patch)
treef8c82d47703aac292ab549c8fe3bfaf046075c1a /whisper
parentf5978639279bac0bcd6270ebb4589099bae570ed (diff)
parent2591883a18113f1b60e6057313ff552c92d7f261 (diff)
downloaddexon-758205b187e079080193c2fed2a21caff2377329.tar
dexon-758205b187e079080193c2fed2a21caff2377329.tar.gz
dexon-758205b187e079080193c2fed2a21caff2377329.tar.bz2
dexon-758205b187e079080193c2fed2a21caff2377329.tar.lz
dexon-758205b187e079080193c2fed2a21caff2377329.tar.xz
dexon-758205b187e079080193c2fed2a21caff2377329.tar.zst
dexon-758205b187e079080193c2fed2a21caff2377329.zip
Merge pull request #648 from Gustav-Simonsson/forward_ecrecover_err_and_remove_dup_checks
Forward and log EC recover err and remove dup pubkey len check
Diffstat (limited to 'whisper')
-rw-r--r--whisper/message.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/whisper/message.go b/whisper/message.go
index 5d9e5b5c1..ad6a1bcff 100644
--- a/whisper/message.go
+++ b/whisper/message.go
@@ -5,6 +5,8 @@ import (
"time"
"github.com/ethereum/go-ethereum/crypto"
+ "github.com/ethereum/go-ethereum/logger"
+ "github.com/ethereum/go-ethereum/logger/glog"
)
type Message struct {
@@ -32,7 +34,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(logger.Error).Infof("Could not get pubkey from signature: ", err)
+ return nil
+ }
+ return pub
}
func (self *Message) Encrypt(to *ecdsa.PublicKey) (err error) {