From 7fc5e62eaaccd75c1ef27b1c3d21e7cefacf2772 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 11 Mar 2009 18:07:22 +0200 Subject: [PATCH] Remember hash algorithm in digest context - alternatively we could reverse map NSS hash types (HASHContext knows its type) but shrug... --- rpmio/digest.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- 2.7.4