From: Panu Matilainen Date: Wed, 11 Mar 2009 16:07:22 +0000 (+0200) Subject: Remember hash algorithm in digest context X-Git-Tag: rpm-4.8.0-beta1~600 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7fc5e62eaaccd75c1ef27b1c3d21e7cefacf2772;p=platform%2Fupstream%2Frpm.git Remember hash algorithm in digest context - alternatively we could reverse map NSS hash types (HASHContext knows its type) but shrug... --- diff --git a/rpmio/digest.c b/rpmio/digest.c index d13d775..a779330 100644 --- a/rpmio/digest.c +++ b/rpmio/digest.c @@ -21,6 +21,7 @@ struct DIGEST_CTX_s { rpmDigestFlags flags; /*!< Bit(s) to control digest operation. */ HASHContext *hashctx; /*!< Internal NSS hash context. */ + pgpHashAlgo algo; /*!< Used hash algorithm */ }; DIGEST_CTX @@ -89,6 +90,7 @@ rpmDigestInit(pgpHashAlgo hashalgo, rpmDigestFlags flags) if ((hashctx = HASH_Create(type)) != NULL) { ctx = xcalloc(1, sizeof(*ctx)); ctx->flags = flags; + ctx->algo = hashalgo; ctx->hashctx = hashctx; HASH_Begin(ctx->hashctx); }