Provide keyboard entropy harvesting for PCVT users.

This commit is contained in:
Mark Murray 2000-09-10 14:31:40 +00:00
parent 22566d9dd5
commit 452d07c1ce
2 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,7 @@
#include <sys/uio.h>
#include <sys/callout.h>
#include <sys/kernel.h>
#include <sys/random.h>
#include <sys/syslog.h>
#include <sys/malloc.h>
#include <sys/time.h>

View File

@ -751,6 +751,8 @@ sgetc(int noblock)
{
keybuf[0] = dt;
random_harvest(keybuf, sizeof(keybuf), 1, 0, RANDOM_KEYBOARD);
return ((u_char *)keybuf);
}
@ -825,6 +827,8 @@ sgetc(int noblock)
/* got a normal scan key */
regular:
random_harvest(&dt, sizeof(dt), 1, 0, RANDOM_KEYBOARD);
#if PCVT_SCANSET == 1
kbd_status.breakseen = dt & 0x80 ? 1 : 0;
dt &= 0x7f;