diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2011-11-07 14:47:03 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2011-11-07 14:47:03 +0200 |
commit | cde47f5945e16033395b5d0023a550b4c01ba0e7 (patch) | |
tree | 096c96ee0c840df3703de913e4da47209bcf1092 /lib/rpmchecksig.c | |
parent | a6f25aff4343c2f67d3fcbfe69929d518327d35f (diff) | |
download | rpm-cde47f5945e16033395b5d0023a550b4c01ba0e7.tar.gz rpm-cde47f5945e16033395b5d0023a550b4c01ba0e7.tar.bz2 rpm-cde47f5945e16033395b5d0023a550b4c01ba0e7.zip |
Use pgpDigParamsAlgo() throughout the codebase
- Tedious but straightforward conversion to use the API instead
of going to the struct directly.
- Remove digest.h includes where no longer necessary
Diffstat (limited to 'lib/rpmchecksig.c')
-rw-r--r-- | lib/rpmchecksig.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 879868f2f..597ceafbb 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -17,7 +17,6 @@ #include <rpm/rpmstring.h> #include <rpm/rpmkeyring.h> -#include "rpmio/digest.h" #include "rpmio/rpmio_internal.h" /* fdSetBundle() */ #include "lib/rpmlead.h" #include "lib/signature.h" @@ -291,6 +290,7 @@ static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, /* XXX RSA needs the hash_algo, so decode early. */ if (sigtag == RPMSIGTAG_RSA || sigtag == RPMSIGTAG_PGP || sigtag == RPMSIGTAG_DSA || sigtag == RPMSIGTAG_GPG) { + unsigned int hashalgo; if (headerGet(sigh, sigtag, &sigtd, HEADERGET_DEFAULT)) { sig = parsePGPSig(&sigtd, "package", fn, &dig); rpmtdFreeData(&sigtd); @@ -298,8 +298,9 @@ static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, if (sig == NULL) goto exit; /* XXX assume same hash_algo in header-only and header+payload */ - rpmDigestBundleAdd(plbundle, sig->hash_algo, RPMDIGEST_NONE); - rpmDigestBundleAdd(hdrbundle, sig->hash_algo, RPMDIGEST_NONE); + hashalgo = pgpDigParamsAlgo(sig, PGPVAL_HASHALGO); + rpmDigestBundleAdd(plbundle, hashalgo, RPMDIGEST_NONE); + rpmDigestBundleAdd(hdrbundle, hashalgo, RPMDIGEST_NONE); } if (headerIsEntry(sigh, RPMSIGTAG_PGP) || @@ -346,7 +347,7 @@ static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags, if (sig == NULL) goto exit; ctx = rpmDigestBundleDupCtx(havekey ? plbundle : hdrbundle, - sig->hash_algo); + pgpDigParamsAlgo(sig, PGPVAL_HASHALGO)); break; case RPMSIGTAG_SHA1: if (nodigests) |