summaryrefslogtreecommitdiff
path: root/lib/signature.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2011-11-07 12:54:30 +0200
committerPanu Matilainen <pmatilai@redhat.com>2011-11-07 12:54:30 +0200
commit0afd3343f00e444e5619b5208773b8121c459d8d (patch)
tree6a97c2d6f5dee0961a875c76966de01cce5884ff /lib/signature.c
parent9134a375f03d48ba40f41437a9089a8a87e21433 (diff)
downloadlibrpm-tizen-0afd3343f00e444e5619b5208773b8121c459d8d.tar.gz
librpm-tizen-0afd3343f00e444e5619b5208773b8121c459d8d.tar.bz2
librpm-tizen-0afd3343f00e444e5619b5208773b8121c459d8d.zip
Eliminate direct pgpDig accesses from lowlevel signature code
Diffstat (limited to 'lib/signature.c')
-rw-r--r--lib/signature.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/signature.c b/lib/signature.c
index ff7a0653d..971a752d9 100644
--- a/lib/signature.c
+++ b/lib/signature.c
@@ -476,15 +476,19 @@ verifySignature(rpmKeyring keyring, pgpDig dig, DIGEST_CTX hashctx, int isHdr,
rpmRC res = RPMRC_FAIL; /* assume failure */
char *sigid = NULL;
*msg = NULL;
+ pgpDigParams sig = pgpDigGetParams(dig, PGPTAG_SIGNATURE);
+ pgpDigParams pub = pgpDigGetParams(dig, PGPTAG_PUBLIC_KEY);
/* Call verify even if we dont have a key for a basic sanity check */
- (void) rpmKeyringLookup(keyring, dig);
- res = pgpVerifySignature(&dig->pubkey, &dig->signature, hashctx);
-
- sigid = pgpIdentItem(&dig->signature);
- rasprintf(msg, "%s%s: %s\n", isHdr ? _("Header ") : "", sigid,
- rpmSigString(res));
- free(sigid);
+ if (sig) {
+ (void) rpmKeyringLookup(keyring, dig);
+ res = pgpVerifySignature(pub, sig, hashctx);
+
+ sigid = pgpIdentItem(sig);
+ rasprintf(msg, "%s%s: %s\n", isHdr ? _("Header ") : "", sigid,
+ rpmSigString(res));
+ free(sigid);
+ }
return res;
}