From b195048bbb27a1aae4aa3938c3b1f79e0a26ae88 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Fri, 3 Sep 2010 15:57:14 +0300 Subject: 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. --- lib/rpmchecksig.c | 8 ++++++-- lib/rpmcli.h | 3 +-- 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 } diff --git a/rpmqv.c b/rpmqv.c index 7332a6f17..a728fdcad 100644 --- a/rpmqv.c +++ b/rpmqv.c @@ -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) -- cgit v1.2.3