summaryrefslogtreecommitdiff
path: root/rpmio/digest.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-03-25 13:23:19 +0200
committerPanu Matilainen <pmatilai@redhat.com>2009-03-25 13:23:19 +0200
commit14468255716a211064f7653e9f582f94f4c25f9a (patch)
tree64bc2a4c256db9e551b6ebc191eb1e8ef316052e /rpmio/digest.c
parent3f6b2f8c7b7b79a59664e16d6d350acb54802171 (diff)
downloadlibrpm-tizen-14468255716a211064f7653e9f582f94f4c25f9a.tar.gz
librpm-tizen-14468255716a211064f7653e9f582f94f4c25f9a.tar.bz2
librpm-tizen-14468255716a211064f7653e9f582f94f4c25f9a.zip
Eliminate header/payload digests from pgpDig_s, they dont belong
- allocate+free digests locally where needed, pass around in separate argument - use digest bundles to handle rpmVerifySignatures() needs - kill-kill-kill fdStealDigest(), dup the contexts from bundles as needed
Diffstat (limited to 'rpmio/digest.c')
-rw-r--r--rpmio/digest.c29
1 files changed, 0 insertions, 29 deletions
diff --git a/rpmio/digest.c b/rpmio/digest.c
index 0779b90de..181a920f3 100644
--- a/rpmio/digest.c
+++ b/rpmio/digest.c
@@ -279,32 +279,3 @@ void fdFiniDigest(FD_t fd, pgpHashAlgo hashalgo,
fdstat_exit(fd, FDSTAT_DIGEST, (ssize_t) 0);
}
}
-
-void fdStealDigest(FD_t fd, pgpDig dig)
-{
- if (fd && fd->digests) {
- rpmDigestBundle bundle = fd->digests;
- for (int i = bundle->index_max; i >= bundle->index_min; i--) {
- DIGEST_CTX ctx = bundle->digests[i];
- if (ctx == NULL)
- continue;
- switch (ctx->algo) {
- case PGPHASHALGO_MD5:
- assert(dig->md5ctx == NULL);
- dig->md5ctx = ctx;
- bundle->digests[i] = NULL;
- break;
- case PGPHASHALGO_SHA1:
- case PGPHASHALGO_SHA256:
- case PGPHASHALGO_SHA384:
- case PGPHASHALGO_SHA512:
- assert(dig->sha1ctx == NULL);
- dig->sha1ctx = ctx;
- bundle->digests[i] = NULL;
- break;
- default:
- break;
- }
- }
- }
-}