whisper: fix spurious From identity with untargeted messages
This commit is contained in:
parent
87447f9f3f
commit
15586368e5
@ -260,9 +260,11 @@ func (self *Whisper) open(envelope *Envelope) *Message {
|
|||||||
// Iterate over the keys and try to decrypt the message
|
// Iterate over the keys and try to decrypt the message
|
||||||
for _, key := range self.keys {
|
for _, key := range self.keys {
|
||||||
message, err := envelope.Open(key)
|
message, err := envelope.Open(key)
|
||||||
if err == nil || err == ecies.ErrInvalidPublicKey {
|
if err == nil {
|
||||||
message.To = &key.PublicKey
|
message.To = &key.PublicKey
|
||||||
return message
|
return message
|
||||||
|
} else if err == ecies.ErrInvalidPublicKey {
|
||||||
|
return message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Failed to decrypt, don't return anything
|
// Failed to decrypt, don't return anything
|
||||||
|
Loading…
Reference in New Issue
Block a user