mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-06 00:38:08 +08:00
fix: --verify forgets the verified key
This commit is contained in:
parent
6bab5ce37c
commit
d001ed7451
@ -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 {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user