Commit c4864449 authored by obscuren's avatar obscuren

Fixed whisper pub key bug

* Unrecoverable messages would cause segfault when recovering invalid
  pub key
parent 54927dc0
...@@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey { ...@@ -92,7 +92,7 @@ func ToECDSAPub(pub []byte) *ecdsa.PublicKey {
} }
func FromECDSAPub(pub *ecdsa.PublicKey) []byte { func FromECDSAPub(pub *ecdsa.PublicKey) []byte {
if pub == nil { if pub == nil || pub.X == nil || pub.Y == nil {
return nil return nil
} }
return elliptic.Marshal(S256(), pub.X, pub.Y) return elliptic.Marshal(S256(), pub.X, pub.Y)
......
...@@ -197,7 +197,7 @@ func (self *Whisper) add(envelope *Envelope) error { ...@@ -197,7 +197,7 @@ func (self *Whisper) add(envelope *Envelope) error {
go self.postEvent(envelope) go self.postEvent(envelope)
} }
wlogger.DebugDetailln("added whisper message") wlogger.DebugDetailf("added whisper envelope %x\n", envelope)
return nil return nil
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment