aboutsummaryrefslogtreecommitdiff
path: root/include/stdlib.h
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2018-08-19 17:40:50 +0000
committerXin LI <delphij@FreeBSD.org>2018-08-19 17:40:50 +0000
commitc1e80940f3b4030df0aaed73028053af057e476d (patch)
treeee75152b4a830a9a9cc43935fc322da1c1241897 /include/stdlib.h
parent38a13e9002540152964435700f0f2a73ad5e2e62 (diff)
Update userland arc4random() with OpenBSD's Chacha20 based arc4random().
ObsoleteFiles.inc: Remove manual pages for arc4random_addrandom(3) and arc4random_stir(3). contrib/ntp/lib/isc/random.c: contrib/ntp/sntp/libevent/evutil_rand.c: Eliminate in-tree usage of arc4random_addrandom(). crypto/heimdal/lib/roken/rand.c: crypto/openssh/config.h: Eliminate in-tree usage of arc4random_stir(). include/stdlib.h: Remove arc4random_stir() and arc4random_addrandom() prototypes, provide temporary shims for transistion period. lib/libc/gen/Makefile.inc: Hook arc4random-compat.c to build, add hint for Chacha20 source for kernel, and remove arc4random_addrandom(3) and arc4random_stir(3) links. lib/libc/gen/arc4random.c: Adopt OpenBSD arc4random.c,v 1.54 with bare minimum changes, use the sys/crypto/chacha20 implementation of keystream. lib/libc/gen/Symbol.map: Remove arc4random_stir and arc4random_addrandom interfaces. lib/libc/gen/arc4random.h: Adopt OpenBSD arc4random.h,v 1.4 but provide _ARC4_LOCK of our own. lib/libc/gen/arc4random.3: Adopt OpenBSD arc4random.3,v 1.35 but keep FreeBSD r114444 and r118247. lib/libc/gen/arc4random-compat.c: Compatibility shims for arc4random_stir and arc4random_addrandom functions to preserve ABI. Log once when called but do nothing otherwise. lib/libc/gen/getentropy.c: lib/libc/include/libc_private.h: Fold __arc4_sysctl into getentropy.c (renamed to arnd_sysctl). Remove from libc_private.h as a result. sys/crypto/chacha20/chacha.c: sys/crypto/chacha20/chacha.h: Make it possible to use the kernel implementation in libc. PR: 182610 Reviewed by: cem, markm Obtained from: OpenBSD Relnotes: yes Differential Revision: https://reviews.freebsd.org/D16760
Notes
svn path=/head/; revision=338059
Diffstat (limited to 'include/stdlib.h')
-rw-r--r--include/stdlib.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/stdlib.h b/include/stdlib.h
index d38952e15629..51f003171451 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -250,11 +250,16 @@ extern void (*malloc_message)(void *, const char *);
void abort2(const char *, int, void **) __dead2;
__uint32_t
arc4random(void);
-void arc4random_addrandom(unsigned char *, int);
void arc4random_buf(void *, size_t);
-void arc4random_stir(void);
__uint32_t
arc4random_uniform(__uint32_t);
+
+#if !defined(BURN_BRIDGES)
+/* Deprecated arc4random() functions */
+#define arc4random_stir()
+#define arc4random_addrandom(a,b)
+#endif
+
#ifdef __BLOCKS__
int atexit_b(void (^ _Nonnull)(void));
void *bsearch_b(const void *, const void *, size_t,