diff options
author | markm <markm@FreeBSD.org> | 2000-07-09 12:26:38 +0000 |
---|---|---|
committer | markm <markm@FreeBSD.org> | 2000-07-09 12:26:38 +0000 |
commit | f0aab2e149e35046e2affbb856cf524f696ab5c8 (patch) | |
tree | 55b29b679f8c930006adda648658fbe227874270 /sys/dev/syscons/sysmouse.c | |
parent | 89ca69193464a4d38b274170f31e1230f83f97d2 (diff) | |
download | FreeBSD-src-f0aab2e149e35046e2affbb856cf524f696ab5c8.zip FreeBSD-src-f0aab2e149e35046e2affbb856cf524f696ab5c8.tar.gz |
Add entropy-harvesting calls.
/dev/random now has new-and-improved entropy!
Diffstat (limited to 'sys/dev/syscons/sysmouse.c')
-rw-r--r-- | sys/dev/syscons/sysmouse.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/dev/syscons/sysmouse.c b/sys/dev/syscons/sysmouse.c index 453215a..5c92b23 100644 --- a/sys/dev/syscons/sysmouse.c +++ b/sys/dev/syscons/sysmouse.c @@ -32,6 +32,7 @@ #include <sys/systm.h> #include <sys/conf.h> #include <sys/proc.h> +#include <sys/random.h> #include <sys/tty.h> #include <sys/kernel.h> @@ -333,6 +334,11 @@ sysmouse_event(mouse_info_t *info) sysmouse_tty); } + /* do the /dev/random device a favour */ + /* The nasty-looking cast is to force treatment of 8 u_chars */ + /* in buf as a u_int64_t */ + random_harvest(*((u_int64_t *)buf), 2, 0, RANDOM_MOUSE); + return mouse_status.flags; } |