mirror of
https://github.com/logos-messaging/go-libp2p-pubsub.git
synced 2026-01-02 21:03:07 +00:00
use MatchesPublicKey, don't rewrite it.
This commit is contained in:
parent
1ef82b2cee
commit
cd32e1772e
9
sign.go
9
sign.go
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user