aboutsummaryrefslogtreecommitdiffstats
path: root/whisper/whisper.go
diff options
context:
space:
mode:
authorPéter Szilágyi <peterke@gmail.com>2015-04-21 17:45:10 +0800
committerPéter Szilágyi <peterke@gmail.com>2015-04-28 15:49:04 +0800
commit15586368e52f49a0f7ea28f890af49d196760846 (patch)
tree27ce5ba80e397792778e0afea0aa40f875237ec7 /whisper/whisper.go
parent87447f9f3f99cc59d58b029fff39fc39142f1281 (diff)
downloaddexon-15586368e52f49a0f7ea28f890af49d196760846.tar
dexon-15586368e52f49a0f7ea28f890af49d196760846.tar.gz
dexon-15586368e52f49a0f7ea28f890af49d196760846.tar.bz2
dexon-15586368e52f49a0f7ea28f890af49d196760846.tar.lz
dexon-15586368e52f49a0f7ea28f890af49d196760846.tar.xz
dexon-15586368e52f49a0f7ea28f890af49d196760846.tar.zst
dexon-15586368e52f49a0f7ea28f890af49d196760846.zip
whisper: fix spurious From identity with untargeted messages
Diffstat (limited to 'whisper/whisper.go')
-rw-r--r--whisper/whisper.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/whisper/whisper.go b/whisper/whisper.go
index 59a1a63c4..61999f07a 100644
--- a/whisper/whisper.go
+++ b/whisper/whisper.go
@@ -260,9 +260,11 @@ func (self *Whisper) open(envelope *Envelope) *Message {
// Iterate over the keys and try to decrypt the message
for _, key := range self.keys {
message, err := envelope.Open(key)
- if err == nil || err == ecies.ErrInvalidPublicKey {
+ if err == nil {
message.To = &key.PublicKey
return message
+ } else if err == ecies.ErrInvalidPublicKey {
+ return message
}
}
// Failed to decrypt, don't return anything