From 7c508b4fba3e383c8c846ca98ec3b303ef659069 Mon Sep 17 00:00:00 2001 From: vyzo Date: Sun, 26 Aug 2018 13:13:12 +0300 Subject: [PATCH] implement validateSignature --- pubsub.go | 6 ++++++ sign.go | 13 +++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 sign.go diff --git a/pubsub.go b/pubsub.go index 0292ab9..e44c467 100644 --- a/pubsub.go +++ b/pubsub.go @@ -496,6 +496,12 @@ func (p *PubSub) validate(vals []*topicVal, src peer.ID, msg *Message) { } func (p *PubSub) validateSignature(msg *Message) bool { + err := verifyMessageSignature(msg.Message) + if err != nil { + log.Debugf("signature verification error: %s", err.Error()) + return false + } + return true } diff --git a/sign.go b/sign.go new file mode 100644 index 0000000..14eb2cc --- /dev/null +++ b/sign.go @@ -0,0 +1,13 @@ +package floodsub + +import ( + pb "github.com/libp2p/go-floodsub/pb" +) + +func verifyMessageSignature(m *pb.Message) error { + return nil +} + +func signMessage(m *pb.Message) { + +}