Harvest mouse events for the entropy device in a better place. In the
new location, all mouse events are harvested, not just the ones being written out to moused(8). This means that mouse entropy is harvested at the consoles as well as in X.
This commit is contained in:
parent
e7b7374b5d
commit
92be8785e1
@ -34,6 +34,7 @@
|
||||
#include <sys/conf.h>
|
||||
#include <sys/signalvar.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/malloc.h>
|
||||
|
||||
@ -616,6 +617,9 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, int flag,
|
||||
case OLD_CONS_MOUSECTL:
|
||||
|
||||
mouse = (mouse_info_t*)data;
|
||||
|
||||
random_harvest(mouse, sizeof(mouse_info_t), 2, 0, RANDOM_MOUSE);
|
||||
|
||||
if (cmd == OLD_CONS_MOUSECTL) {
|
||||
static u_char swapb[] = { 0, 4, 2, 6, 1, 5, 3, 7 };
|
||||
old_mouse_info_t *old_mouse = (old_mouse_info_t *)data;
|
||||
|
@ -32,7 +32,6 @@
|
||||
#include <sys/systm.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/proc.h>
|
||||
#include <sys/random.h>
|
||||
#include <sys/tty.h>
|
||||
#include <sys/kernel.h>
|
||||
|
||||
@ -337,8 +336,6 @@ sysmouse_event(mouse_info_t *info)
|
||||
sysmouse_tty);
|
||||
}
|
||||
|
||||
random_harvest(buf, sizeof(buf), 2, 0, RANDOM_MOUSE);
|
||||
|
||||
return mouse_status.flags;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user