summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/rand48.h
diff options
context:
space:
mode:
authorderaadt <>2014-12-08 21:45:20 +0000
committerderaadt <>2014-12-08 21:45:20 +0000
commit1e2b0be5bee045db1b0abb1f87801004db563bb8 (patch)
treebf17a76201de02c2ce50358a383001a6b6c5cc64 /src/lib/libc/stdlib/rand48.h
parent4b0b4fc5d98edef87738071b3784e13573327bab (diff)
downloadopenbsd-1e2b0be5bee045db1b0abb1f87801004db563bb8.tar.gz
openbsd-1e2b0be5bee045db1b0abb1f87801004db563bb8.tar.bz2
openbsd-1e2b0be5bee045db1b0abb1f87801004db563bb8.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 'src/lib/libc/stdlib/rand48.h')
-rw-r--r--src/lib/libc/stdlib/rand48.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/rand48.h b/src/lib/libc/stdlib/rand48.h
index afa49f65f3..ee70174744 100644
--- a/src/lib/libc/stdlib/rand48.h
+++ b/src/lib/libc/stdlib/rand48.h
@@ -10,7 +10,7 @@
10 * of any kind. I shall in no event be liable for anything that happens 10 * of any kind. I shall in no event be liable for anything that happens
11 * to anyone/anything when using this software. 11 * to anyone/anything when using this software.
12 * 12 *
13 * $OpenBSD: rand48.h,v 1.3 2002/02/16 21:27:24 millert Exp $ 13 * $OpenBSD: rand48.h,v 1.4 2014/12/08 21:45:20 deraadt Exp $
14 */ 14 */
15 15
16#ifndef _RAND48_H_ 16#ifndef _RAND48_H_
@@ -20,6 +20,7 @@
20#include <stdlib.h> 20#include <stdlib.h>
21 21
22void __dorand48(unsigned short[3]); 22void __dorand48(unsigned short[3]);
23extern int __rand48_deterministic;
23 24
24#define RAND48_SEED_0 (0x330e) 25#define RAND48_SEED_0 (0x330e)
25#define RAND48_SEED_1 (0xabcd) 26#define RAND48_SEED_1 (0xabcd)