提交 15586368 编写于 作者: P Péter Szilágyi

whisper: fix spurious From identity with untargeted messages

上级 87447f9f
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册