From e7b4d4feb46cebae30246558ec2eac22c4897e62 Mon Sep 17 00:00:00 2001 From: Brian Wellington Date: Tue, 26 Oct 1999 19:43:25 +0000 Subject: [PATCH] fix context handling --- lib/dns/sec/dst/hmac_link.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/dns/sec/dst/hmac_link.c b/lib/dns/sec/dst/hmac_link.c index df76d1241a..4fff9b7f2b 100644 --- a/lib/dns/sec/dst/hmac_link.c +++ b/lib/dns/sec/dst/hmac_link.c @@ -17,7 +17,7 @@ /* * Principal Author: Brian Wellington - * $Id: hmac_link.c,v 1.12 1999/10/20 22:14:14 bwelling Exp $ + * $Id: hmac_link.c,v 1.13 1999/10/26 19:43:25 bwelling Exp $ */ #include @@ -128,7 +128,13 @@ dst_hmacmd5_sign(const unsigned int mode, dst_key_t *key, void **context, { isc_region_t r; isc_result_t ret; - + void *ctx; + + if (!(mode & DST_SIGMODE_ALL)) + REQUIRE(context != NULL); + else + context = &ctx; + if (mode & DST_SIGMODE_INIT) { HMAC_Key *hkey = key->opaque; @@ -187,7 +193,13 @@ dst_hmacmd5_verify(const unsigned int mode, dst_key_t *key, void **context, { isc_region_t r; isc_result_t ret; - + void *ctx; + + if (!(mode & DST_SIGMODE_ALL)) + REQUIRE(context != NULL); + else + context = &ctx; + if (mode & DST_SIGMODE_INIT) { HMAC_Key *hkey = key->opaque;