fix: --verify forgets the verified key

This commit is contained in:
Laurent Senta 2023-03-09 15:23:52 +01:00 committed by galargh
parent 6bab5ce37c
commit d001ed7451

View File

@ -222,6 +222,20 @@ Passing --verify will verify signature against provided public key.
// Peer ID.
if len(entry.PubKey) > 0 {
pub, err = ic.UnmarshalPublicKey(entry.PubKey)
if err != nil {
return err
}
// Verify the public key matches the name we are verifying.
entryID, err := peer.IDFromPublicKey(pub)
if err != nil {
return err
}
if id != entryID {
return fmt.Errorf("record public key does not match the verified name")
}
}
}
if err != nil {