diff options
author | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 02:48:56 +0800 |
---|---|---|
committer | Jeffrey Wilcke <jeffrey@ethereum.org> | 2015-04-08 02:48:56 +0800 |
commit | 758205b187e079080193c2fed2a21caff2377329 (patch) | |
tree | f8c82d47703aac292ab549c8fe3bfaf046075c1a /whisper/message.go | |
parent | f5978639279bac0bcd6270ebb4589099bae570ed (diff) | |
parent | 2591883a18113f1b60e6057313ff552c92d7f261 (diff) | |
download | go-tangerine-758205b187e079080193c2fed2a21caff2377329.tar.gz go-tangerine-758205b187e079080193c2fed2a21caff2377329.tar.zst go-tangerine-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/message.go')
-rw-r--r-- | whisper/message.go | 9 |
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) { |