Revert to the more correct array size, and correct a KASSERT to

only allow proper values. ENTROPYSOURCE is a maxval+1, not an
allowable number.

Suggested loose protons in the solution:	phk
Prefers to keep the pH close to seven:		markm
This commit is contained in:
Mark Murray 2005-03-29 11:08:45 +00:00
parent 9f3d9acd26
commit 3a0323d92f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=144291

View File

@ -90,7 +90,7 @@ static struct entropyfifo emptyfifo;
#define EMPTYBUFFERS 1024
/* Harvested entropy */
static struct entropyfifo harvestfifo[ENTROPYSOURCE + 1];
static struct entropyfifo harvestfifo[ENTROPYSOURCE];
/* <0 to end the kthread, 0 to let it run */
static int random_kthread_control = 0;
@ -302,7 +302,7 @@ random_harvest_internal(u_int64_t somecounter, const void *entropy,
KASSERT(origin == RANDOM_START || origin == RANDOM_WRITE ||
origin == RANDOM_KEYBOARD || origin == RANDOM_MOUSE ||
origin == RANDOM_NET || origin == RANDOM_INTERRUPT ||
origin == RANDOM_PURE || origin == ENTROPYSOURCE,
origin == RANDOM_PURE,
("random_harvest_internal: origin %d invalid\n", origin));
/* Lockless read to avoid lock operations if fifo is full. */