summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorThomas Nordin <nordin@cvs.openbsd.org>2002-01-03 09:23:23 +0000
committerThomas Nordin <nordin@cvs.openbsd.org>2002-01-03 09:23:23 +0000
commitb73ad98ab184d778427b6f5e603fb9df18878950 (patch)
tree6596a66767548540fff52c79de7402534bffab3e /sys/dev
parent1f25dfca22a3bf80b363818b16c6d968b5639218 (diff)
Restore entropy_count calculation. mickey@ ok
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/rnd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 3bfc565c872..9c44c5ac193 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.51 2001/12/29 17:22:41 mickey Exp $ */
+/* $OpenBSD: rnd.c,v 1.52 2002/01/03 09:23:22 nordin Exp $ */
/*
* random.c -- A strong random number generator
@@ -862,8 +862,8 @@ extract_entropy(buf, nbytes)
MD5Init(&tmp);
s = splhigh();
MD5Update(&tmp, (u_int8_t*)rs->pool, sizeof(rs->pool));
- if (rs->entropy_count / 8 > i)
- rs->entropy_count -= i * 8;
+ if (rs->entropy_count / 8 > nbytes)
+ rs->entropy_count -= nbytes * 8;
else
rs->entropy_count = 0;
MD5Final(buffer, &tmp);