Provide keyboard entropy harvesting for PCVT users.
This commit is contained in:
parent
22566d9dd5
commit
452d07c1ce
@ -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>
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user