diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-11-06 20:43:57 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-11-07 08:05:25 +0200 |
commit | 44f1c853fd776f50f58f300e6045d45d73ff5566 (patch) | |
tree | 9ccfe6c4c54481a3060301a89460aaaf6fc95942 | |
parent | 03879e09cf880adf6c2cec5c73779d77bd6a7f95 (diff) | |
download | librpm-tizen-44f1c853fd776f50f58f300e6045d45d73ff5566.tar.gz librpm-tizen-44f1c853fd776f50f58f300e6045d45d73ff5566.tar.bz2 librpm-tizen-44f1c853fd776f50f58f300e6045d45d73ff5566.zip |
Eliminate couple of unnecessary pgpDig usages
- stashKeyid() only wants the signature, not the whole dig
- dig argument to readFile() was simply unused
-rw-r--r-- | lib/package.c | 7 | ||||
-rw-r--r-- | lib/rpmchecksig.c | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/package.c b/lib/package.c index d70d2d3e5..08d2cc32a 100644 --- a/lib/package.c +++ b/lib/package.c @@ -107,13 +107,12 @@ static void headerMergeLegacySigs(Header h, Header sigh) * @param dig OpenPGP packet containter * @return 0 if new keyid, otherwise 1 */ -static int stashKeyid(pgpDig dig) +static int stashKeyid(pgpDigParams sigp) { - pgpDigParams sigp = dig ? &dig->signature : NULL; unsigned int keyid; int i; - if (dig == NULL || sigp == NULL) + if (sigp == NULL) return 0; keyid = pgpGrab(sigp->signid+4, 4); @@ -649,7 +648,7 @@ static rpmRC rpmpkgRead(rpmKeyring keyring, rpmVSFlags vsflags, case RPMRC_NOTTRUSTED: /* Signature is OK, but key is not trusted. */ case RPMRC_NOKEY: /* Public key is unavailable. */ /* XXX Print NOKEY/NOTTRUSTED warning only once. */ - { int lvl = (stashKeyid(dig) ? RPMLOG_DEBUG : RPMLOG_WARNING); + { int lvl = (stashKeyid(&dig->signature) ? RPMLOG_DEBUG : RPMLOG_WARNING); rpmlog(lvl, "%s: %s", fn, msg); } break; case RPMRC_NOTFOUND: /* Signature is unknown type. */ diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 5829c6d09..44f27f36e 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -105,7 +105,7 @@ int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv) /** * @todo If the GPG key was known available, the md5 digest could be skipped. */ -static int readFile(FD_t fd, const char * fn, pgpDig dig, +static int readFile(FD_t fd, const char * fn, rpmDigestBundle plbundle, rpmDigestBundle hdrbundle) { unsigned char buf[4*BUFSIZ]; @@ -337,7 +337,7 @@ static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, /* Read the file, generating digest(s) on the fly. */ fdSetBundle(fd, plbundle); - if (readFile(fd, fn, dig, plbundle, hdrbundle)) { + if (readFile(fd, fn, plbundle, hdrbundle)) { goto exit; } |