Skip to content

Commit

Permalink
[FAB-4557] gossip: Do not sign block messages
Browse files Browse the repository at this point in the history
In gossip we currently sign every message in the following way:
- Message sent by the Gossip() API call - uses the peer's signing identity
  to sign the message.
- Message sent via Send() is signed in a NOOP manner (the signature is empty)

Since blocks are already signed by the ordering service
there is no point in signing them with the peer's signing identity.
This commit makes such message be NOOP-signed.

Change-Id: I0e5dca73e2ba3e711955829435172ed7f0365b61
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Jun 12, 2017
1 parent 076fb52 commit 961ccab
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions gossip/gossip/gossip_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,9 +629,15 @@ func (g *gossipServiceImpl) Gossip(msg *proto.GossipMessage) {
GossipMessage: msg,
}

_, err := sMsg.Sign(func(msg []byte) ([]byte, error) {
return g.mcs.Sign(msg)
})
var err error
if sMsg.IsDataMsg() {
sMsg, err = sMsg.NoopSign()
} else {
_, err = sMsg.Sign(func(msg []byte) ([]byte, error) {
return g.mcs.Sign(msg)
})
}

if err != nil {
g.logger.Warning("Failed signing message:", err)
return
Expand Down

0 comments on commit 961ccab

Please sign in to comment.