Add a check for incorrect public key.
This commit is contained in:
parent
7bf1e55204
commit
7e84c64397
1 changed files with 3 additions and 2 deletions
|
@ -203,12 +203,13 @@ func verify(s *options.Spec, opt *options.Options) {
|
|||
fn := opt.Args[2]
|
||||
|
||||
sig, err := sign.ReadSignature(sn)
|
||||
if err != nil { die("%s: Can't read signature %s: %s", Z, sn, err) }
|
||||
|
||||
if err != nil { die("%s: Can't read signature '%s': %s", Z, sn, err) }
|
||||
|
||||
pk, err := sign.ReadPublicKey(pn)
|
||||
if err != nil { die("%s: %s", Z, err) }
|
||||
|
||||
if !sig.IsPKMatch(pk) { die("Wrong public key '%s' for verifying '%s'", pn, sn) }
|
||||
|
||||
ok, err := pk.VerifyFile(fn, sig)
|
||||
if err != nil { die("%s: %s", Z, err) }
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue