summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2017-04-13 11:03:03 +0300
committerPanu Matilainen <pmatilai@redhat.com>2017-04-13 11:03:03 +0300
commit3a18e1a1781bbd00b4be59064bc5f02a662ab418 (patch)
tree1fbc292a481a5205d29e9ae2205cfae0598e9d49
parente47733bb89ef6435cb06e4f62823bf44cb4e24ff (diff)
downloadrpm-3a18e1a1781bbd00b4be59064bc5f02a662ab418.tar.gz
Do manual hdrblobRead() and -Import instead of rpmReadSignature()
Not useful in itself, but paving way for next steps.
-rw-r--r--lib/rpmchecksig.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c
index 737b3246b..cc7152f12 100644
--- a/lib/rpmchecksig.c
+++ b/lib/rpmchecksig.c
@@ -300,15 +300,18 @@ static int rpmpkgVerifySigs(rpmKeyring keyring, rpmQueryFlags flags,
char * msg = NULL;
rpmRC rc = RPMRC_FAIL; /* assume failure */
int failed = 0;
- struct hdrblob_s blob;
+ struct hdrblob_s sigblob, blob;
rpmTagVal copyTags[] = { RPMTAG_PAYLOADDIGEST, 0 };
memset(&blob, 0, sizeof(blob));
+ memset(&sigblob, 0, sizeof(sigblob));
if (rpmLeadRead(fd, NULL, &msg))
goto exit;
- if (rpmReadSignature(fd, &sigh, &msg))
+ if (hdrblobRead(fd, 1, 1, RPMTAG_HEADERSIGNATURES, &sigblob, &msg))
+ goto exit;
+ if (hdrblobImport(&sigblob, 0, &sigh, &msg))
goto exit;
/* Initialize digests ranging over the header */
@@ -363,6 +366,7 @@ exit:
rpmlog(RPMLOG_ERR, "%s: %s\n", fn, msg);
free(msg);
free(buf);
+ free(sigblob.ei);
free(blob.ei);
free(missingKeys);
free(untrustedKeys);