From 14468255716a211064f7653e9f582f94f4c25f9a Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 25 Mar 2009 13:23:19 +0200 Subject: 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 --- rpmio/digest.c | 29 ----------------------------- 1 file changed, 29 deletions(-) (limited to 'rpmio/digest.c') 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; - } - } - } -} -- cgit v1.2.3