]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
hmac_link.c
authorDavid Lawrence <source@isc.org>
Thu, 31 May 2001 10:47:17 +0000 (10:47 +0000)
committerDavid Lawrence <source@isc.org>
Thu, 31 May 2001 10:47:17 +0000 (10:47 +0000)
lib/dns/sec/dst/hmac_link.c

index 6409ad0f36366e54ff4351c388a9d393db2b3c31..bc6438dfc5e17ca180d183d1dd49e5c0968d3386 100644 (file)
@@ -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 <config.h>
@@ -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);