From a0dc53dd581a2b896402fee2f257ef81af2eb014 Mon Sep 17 00:00:00 2001 From: Michael Graff Date: Sat, 10 Jun 2000 00:52:56 +0000 Subject: [PATCH] check in a debugging printf, to help track down a problem on linux --- lib/isc/unix/entropy.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/lib/isc/unix/entropy.c b/lib/isc/unix/entropy.c index 9c693f741c..1580eaffd4 100644 --- a/lib/isc/unix/entropy.c +++ b/lib/isc/unix/entropy.c @@ -316,7 +316,7 @@ get_from_filesource(isc_entropysource_t *source, isc_uint32_t desired) { */ static void fillpool(isc_entropy_t *ent, unsigned int needed, isc_boolean_t blocking) { - isc_uint32_t added, desired; + isc_uint32_t added; isc_entropysource_t *source; REQUIRE(VALID_ENTROPY(ent)); @@ -374,6 +374,8 @@ fillpool(isc_entropy_t *ent, unsigned int needed, isc_boolean_t blocking) { * others are always drained. */ + printf("Waiting for %u bytes...\n", needed); + again: source = ISC_LIST_HEAD(ent->sources); added = 0; @@ -397,6 +399,8 @@ fillpool(isc_entropy_t *ent, unsigned int needed, isc_boolean_t blocking) { goto again; } + printf("Got %u bytes...\n", added); + /* * Adjust counts. */ @@ -506,18 +510,13 @@ isc_entropy_getdata(isc_entropy_t *ent, void *data, unsigned int length, unsigned int needcount; fillcount = ISC_MAX(remain * 8, count * 8); - needcount = ISC_MAX(count * 8, - RND_ENTROPY_THRESHOLD * 8); + needcount = RND_ENTROPY_THRESHOLD * 8; fillpool(ent, fillcount, blocking); - if (!partial && !blocking) + if (!partial) if (ent->pool.entropy < needcount) goto zeroize; - if (blocking - && (ent->pool.entropy - < RND_ENTROPY_THRESHOLD * 8)) - goto zeroize; } else { /* * If we've extracted half our pool size in bits