diff options
author | Péter Szilágyi <peterke@gmail.com> | 2015-04-21 17:45:10 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2015-04-28 15:49:04 +0800 |
commit | 15586368e52f49a0f7ea28f890af49d196760846 (patch) | |
tree | 27ce5ba80e397792778e0afea0aa40f875237ec7 | |
parent | 87447f9f3f99cc59d58b029fff39fc39142f1281 (diff) | |
download | dexon-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
-rw-r--r-- | whisper/whisper.go | 4 |
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 |