whisper: verification bug fixed

This commit is contained in:
Vlad 2017-02-01 22:40:17 +01:00
parent 0a7e128811
commit 3e358132fa

View file

@ -171,6 +171,9 @@ func (s *WMailServer) validateRequest(peerID []byte, request *whisper.Envelope)
}
src := crypto.FromECDSAPub(decrypted.Src)
if len(src)-len(peerID) == 1 {
src = src[1:]
}
if !bytes.Equal(peerID, src) {
glog.V(logger.Warn).Infof("Wrong signature of p2p request")
return false, 0, 0, topic