From d744418e64132f1e61a22ccf8ba36ece6dc44bda Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Thu, 31 May 2001 10:47:17 +0000 Subject: [PATCH] hmac_link.c --- lib/dns/sec/dst/hmac_link.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/dns/sec/dst/hmac_link.c b/lib/dns/sec/dst/hmac_link.c index 6409ad0f36..bc6438dfc5 100644 --- a/lib/dns/sec/dst/hmac_link.c +++ b/lib/dns/sec/dst/hmac_link.c @@ -19,7 +19,7 @@ /* * Principal Author: Brian Wellington - * $Id: hmac_link.c,v 1.50 2001/05/10 19:07:15 bwelling Exp $ + * $Id: hmac_link.c,v 1.51 2001/05/31 10:47:17 tale Exp $ */ #include @@ -124,14 +124,12 @@ hmacmd5_compare(const dst_key_t *key1, const dst_key_t *key2) { } static isc_result_t -hmacmd5_generate(dst_key_t *key, int unused) { +hmacmd5_generate(dst_key_t *key, int good_entropy) { isc_buffer_t b; isc_result_t ret; int bytes; unsigned char data[HMAC_LEN]; - UNUSED(unused); - bytes = (key->key_size + 7) / 8; if (bytes > 64) { bytes = 64; @@ -139,7 +137,8 @@ hmacmd5_generate(dst_key_t *key, int unused) { } memset(data, 0, HMAC_LEN); - ret = dst__entropy_getdata(data, bytes, ISC_FALSE); + ret = dst__entropy_getdata(data, bytes, + good_entropy != 0 ? ISC_FALSE : ISC_TRUE); if (ret != ISC_R_SUCCESS) return (ret);