summaryrefslogtreecommitdiffstats
path: root/sys/dev/rndvar.h
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2016-05-17 21:05:49 +0000
committertedu <tedu@openbsd.org>2016-05-17 21:05:49 +0000
commit83a0fc521db1eeb5a15be2825f2131768b37819b (patch)
treeb062b807507974bc698701d76762828ac7a14679 /sys/dev/rndvar.h
parentFix "skeyinit username" run as root. Also reduce the pledge (diff)
downloadwireguard-openbsd-83a0fc521db1eeb5a15be2825f2131768b37819b.tar.xz
wireguard-openbsd-83a0fc521db1eeb5a15be2825f2131768b37819b.zip
Change the random event buffer from a queue to an endless ring. This way
we don't drop any events when the queue is full. They are instead mixed into previous events. The mixing function selected is addition instead of xor to reduce the possibility that new values effectively erase existing ones. Convert some types to u_int to ensure defined overflow. ok deraadt djm
Diffstat (limited to 'sys/dev/rndvar.h')
-rw-r--r--sys/dev/rndvar.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/rndvar.h b/sys/dev/rndvar.h
index 024115491d7..3eac8ab1c91 100644
--- a/sys/dev/rndvar.h
+++ b/sys/dev/rndvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rndvar.h,v 1.36 2015/02/07 01:19:40 deraadt Exp $ */
+/* $OpenBSD: rndvar.h,v 1.37 2016/05/17 21:05:49 tedu Exp $ */
/*
* Copyright (c) 1996,2000 Michael Shalayeff.
@@ -71,7 +71,7 @@ extern struct rndstats rndstats;
void random_start(void);
-void enqueue_randomness(int, int);
+void enqueue_randomness(unsigned int, unsigned int);
void suspend_randomness(void);
void resume_randomness(char *, size_t);