mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Provide keyboard entropy harvesting for PCVT users.
This commit is contained in:
parent
22566d9dd5
commit
452d07c1ce
2 changed files with 5 additions and 0 deletions
|
|
@ -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 @@ loop:
|
|||
{
|
||||
keybuf[0] = dt;
|
||||
|
||||
random_harvest(keybuf, sizeof(keybuf), 1, 0, RANDOM_KEYBOARD);
|
||||
|
||||
return ((u_char *)keybuf);
|
||||
}
|
||||
|
||||
|
|
@ -825,6 +827,8 @@ loop:
|
|||
/* 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 a new issue