summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/rand48.h
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-12-08 21:45:19 +0000
committerderaadt <deraadt@openbsd.org>2014-12-08 21:45:19 +0000
commitf7510a6ece7d11f60752a2ac701b127e460d8361 (patch)
tree1513b6608a14d945d1d50bdb13e294073890e337 /lib/libc/stdlib/rand48.h
parenttypo (diff)
downloadwireguard-openbsd-f7510a6ece7d11f60752a2ac701b127e460d8361.tar.xz
wireguard-openbsd-f7510a6ece7d11f60752a2ac701b127e460d8361.zip
Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()
to returning strong random by default, source from arc4random(3). Parameters to the seeding functions are ignored, and the subsystems remain in strong random mode. If you wish the standardized deterministic mode, call srand_deterministic(), srandom_determistic(), srand48_deterministic(), seed48_deterministic() or lcong48_deterministic() instead. The re-entrant functions rand_r(), erand48(), nrand48(), jrand48() are unaffected by this change and remain in deterministic mode (for now). Verified as a good roadmap forward by auditing 8800 pieces of software. Roughly 60 pieces of software will need adaptation to request the deterministic mode. Violates POSIX and C89, which violate best practice in this century. ok guenther tedu millert
Diffstat (limited to 'lib/libc/stdlib/rand48.h')
-rw-r--r--lib/libc/stdlib/rand48.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/stdlib/rand48.h b/lib/libc/stdlib/rand48.h
index afa49f65f3c..ee701747442 100644
--- a/lib/libc/stdlib/rand48.h
+++ b/lib/libc/stdlib/rand48.h
@@ -10,7 +10,7 @@
* of any kind. I shall in no event be liable for anything that happens
* to anyone/anything when using this software.
*
- * $OpenBSD: rand48.h,v 1.3 2002/02/16 21:27:24 millert Exp $
+ * $OpenBSD: rand48.h,v 1.4 2014/12/08 21:45:20 deraadt Exp $
*/
#ifndef _RAND48_H_
@@ -20,6 +20,7 @@
#include <stdlib.h>
void __dorand48(unsigned short[3]);
+extern int __rand48_deterministic;
#define RAND48_SEED_0 (0x330e)
#define RAND48_SEED_1 (0xabcd)