From b353ddca06e89cd50ab9f4f14c1d1e9349c7afd6 Mon Sep 17 00:00:00 2001 From: vyzo Date: Wed, 5 Sep 2018 20:48:44 +0300 Subject: [PATCH] more idiomatic message copying for signature purposes --- sign.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sign.go b/sign.go index 1bd04ab..7d261d9 100644 --- a/sign.go +++ b/sign.go @@ -17,12 +17,9 @@ func verifyMessageSignature(m *pb.Message) error { return err } - xm := pb.Message{ - Data: m.Data, - TopicIDs: m.TopicIDs, - From: m.From, - Seqno: m.Seqno, - } + xm := *m + xm.Signature = nil + xm.Key = nil bytes, err := xm.Marshal() if err != nil { return err