From b7ddf59a051cbfb4a778b42b1a1d228b1e2683db Mon Sep 17 00:00:00 2001 From: capossele <angelocapossele@gmail.com> Date: Fri, 20 Mar 2020 21:30:41 +0000 Subject: [PATCH] :lock: adds distributed public key check --- .../drng/subtypes/collectiveBeacon/collective_beacon.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go b/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go index 971e5559..f5f3a560 100644 --- a/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go +++ b/packages/binary/drng/subtypes/collectiveBeacon/collective_beacon.go @@ -1,6 +1,7 @@ package collectiveBeacon import ( + "bytes" "crypto/sha512" "errors" @@ -47,6 +48,10 @@ func VerifyCollectiveBeacon(state *state.State, data *events.CollectiveBeaconEve return err } + if !bytes.Equal(data.Dpk, state.Committee().DistributedPK) { + return errors.New("Distributed Public Key does not match") + } + if err := verifySignature(data); err != nil { return err } -- GitLab