summaryrefslogtreecommitdiff
path: root/sys/dev/rnd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/rnd.c')
-rw-r--r--sys/dev/rnd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/rnd.c b/sys/dev/rnd.c
index 3605052b0fd..a01e491ad28 100644
--- a/sys/dev/rnd.c
+++ b/sys/dev/rnd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rnd.c,v 1.169 2015/01/27 03:17:35 dlg Exp $ */
+/* $OpenBSD: rnd.c,v 1.170 2015/02/07 01:19:40 deraadt Exp $ */
/*
* Copyright (c) 2011 Theo de Raadt.
@@ -246,6 +246,8 @@ int filt_randomread(struct knote *, long);
void filt_randomdetach(struct knote *);
int filt_randomwrite(struct knote *, long);
+static void _rs_seed(u_char *, size_t);
+
struct filterops randomread_filtops =
{ 1, NULL, filt_randomdetach, filt_randomread };
struct filterops randomwrite_filtops =
@@ -560,10 +562,12 @@ suspend_randomness(void)
}
void
-resume_randomness(void)
+resume_randomness(char *buf, size_t buflen)
{
struct timespec ts;
+ if (buf && buflen)
+ _rs_seed(buf, sizeof(buf));
getnanotime(&ts);
add_true_randomness(ts.tv_sec);
add_true_randomness(ts.tv_nsec);