use MatchesPublicKey, don't rewrite it.

This commit is contained in:
vyzo 2018-08-27 10:57:05 +03:00
parent 1ef82b2cee
commit cd32e1772e
1 changed files with 2 additions and 7 deletions

View File

@ -30,13 +30,8 @@ func verifyMessageSignature(m *pb.Message) error {
}
// verify that the source ID matches the attached key
xpid, err := peer.IDFromPublicKey(pubk)
if err != nil {
return err
}
if pid != xpid {
return fmt.Errorf("bad signing key; source ID/key mismatch: %s %s", pid, xpid)
if !pid.MatchesPublicKey(pubk) {
return fmt.Errorf("bad signing key; source ID %s doesn't match key", pid)
}
}