diff options
author | obscuren <geffobscura@gmail.com> | 2015-01-30 20:24:20 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2015-01-30 20:24:20 +0800 |
commit | c48644490f039fb9756b4cd1fedf11fbb1c4a16f (patch) | |
tree | 1e574af895c8702e64bd958b52d20df2a28b1c24 | |
parent | 54927dc0e0b99009f92fbb7b28d71ae20179ce1e (diff) | |
download | dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.gz dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.bz2 dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.lz dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.xz dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.tar.zst dexon-c48644490f039fb9756b4cd1fedf11fbb1c4a16f.zip |
Fixed whisper pub key bug
* Unrecoverable messages would cause segfault when recovering invalid
pub key
-rw-r--r-- | crypto/crypto.go | 2 | ||||
-rw-r--r-- | whisper/whisper.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go index effa703d0..d56b9112f 100644 --- a/crypto/crypto.go +++ b/crypto/crypto.go @@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey { } func FromECDSAPub(pub *ecdsa.PublicKey) []byte { - if pub == nil { + if pub == nil || pub.X == nil || pub.Y == nil { return nil } return elliptic.Marshal(S256(), pub.X, pub.Y) diff --git a/whisper/whisper.go b/whisper/whisper.go index 76cfe34a4..8eab0825b 100644 --- a/whisper/whisper.go +++ b/whisper/whisper.go @@ -197,7 +197,7 @@ func (self *Whisper) add(envelope *Envelope) error { go self.postEvent(envelope) } - wlogger.DebugDetailln("added whisper message") + wlogger.DebugDetailf("added whisper envelope %x\n", envelope) return nil } |