diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-03 15:57:14 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-03 15:57:14 +0300 |
commit | b195048bbb27a1aae4aa3938c3b1f79e0a26ae88 (patch) | |
tree | 6f08bed777dcb057460179ec490a46f9cfbbaa19 | |
parent | 5b717266644f939aaa7ec2be7b2a6673df5556dc (diff) | |
download | librpm-tizen-b195048bbb27a1aae4aa3938c3b1f79e0a26ae88.tar.gz librpm-tizen-b195048bbb27a1aae4aa3938c3b1f79e0a26ae88.tar.bz2 librpm-tizen-b195048bbb27a1aae4aa3938c3b1f79e0a26ae88.zip |
Further simplify rpmcliVerifySignatures()
- Since this is a rpmcliFoo() function, we can assume rpmcliInit()
is used and the verify disabling bits are set through the common
rpmcliQueryFlags set, making qva argument unnecessary.
-rw-r--r-- | lib/rpmchecksig.c | 8 | ||||
-rw-r--r-- | lib/rpmcli.h | 3 | ||||
-rw-r--r-- | rpmqv.c | 8 |
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 25679a5ee..7ad319b87 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -439,18 +439,22 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn) return rc; } -int rpmcliVerifySignatures(rpmts ts, QVA_t qva, ARGV_const_t argv) +int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv) { const char * arg; int res = 0; rpmKeyring keyring = rpmtsGetKeyring(ts, 1); + rpmVerifyFlags verifyFlags = (VERIFY_DIGEST|VERIFY_SIGNATURE); + + verifyFlags &= ~rpmcliQueryFlags; + while ((arg = *argv++) != NULL) { FD_t fd = Fopen(arg, "r.ufdio"); if (fd == NULL || Ferror(fd)) { rpmlog(RPMLOG_ERR, _("%s: open failed: %s\n"), arg, Fstrerror(fd)); res++; - } else if (rpmpkgVerifySigs(keyring, qva->qva_flags, fd, arg)) { + } else if (rpmpkgVerifySigs(keyring, verifyFlags, fd, arg)) { res++; } diff --git a/lib/rpmcli.h b/lib/rpmcli.h index 8297f1cda..001df9f97 100644 --- a/lib/rpmcli.h +++ b/lib/rpmcli.h @@ -455,11 +455,10 @@ int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv); /** \ingroup rpmcli * Verify package signatures * @param ts transaction set - * @param qva mode flags and parameters * @param argv array of package path arguments (NULL terminated) * @return 0 on success */ -int rpmcliVerifySignatures(rpmts ts, QVA_t qva, ARGV_const_t argv); +int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv); #ifdef __cplusplus } @@ -413,14 +413,8 @@ int main(int argc, char *argv[]) ec = rpmcliImportPubkeys(ts, (ARGV_const_t) poptGetArgs(optCon)); break; case MODE_CHECKSIG: - { rpmVerifyFlags verifyFlags = - (VERIFY_FILEDIGEST|VERIFY_DIGEST|VERIFY_SIGNATURE); - - verifyFlags &= ~rpmcliQueryFlags; - ka->qva_flags = (rpmQueryFlags) verifyFlags; - ec = rpmcliVerifySignatures(ts, ka, (ARGV_const_t) poptGetArgs(optCon)); + ec = rpmcliVerifySignatures(ts, (ARGV_const_t) poptGetArgs(optCon)); break; - } #endif /* IAM_RPMK */ #if !defined(IAM_RPMQV) |