Use upstream OpenBSD's arc4random.

The getentropy_linux.c is lightly modified to build on Android, but we're now
completely in sync with upstream OpenBSD's arc4random implementation.

Change-Id: If32229fc28aba908035fb38703190d41ddcabc95
This commit is contained in:
Elliott Hughes
2014-07-18 15:57:41 -07:00
parent 1fb90a8aa0
commit 2b67d7dee0
8 changed files with 915 additions and 291 deletions

View File

@@ -18,6 +18,7 @@
#define _BIONIC_OPENBSD_COMPAT_H_included
#include <sys/cdefs.h>
#include <stddef.h> // For size_t.
#define __USE_BSD
@@ -36,6 +37,11 @@
/* OpenBSD has this, but we can't really implement it correctly on Linux. */
#define issetugid() 0
#define explicit_bzero(p, s) memset(p, 0, s)
/* We have OpenBSD's getentropy_linux.c, but we don't mention getentropy in any header. */
__LIBC_HIDDEN__ extern int getentropy(void*, size_t);
/* LP32 NDK ctype.h contained references to these. */
__LIBC64_HIDDEN__ extern const short* _tolower_tab_;
__LIBC64_HIDDEN__ extern const short* _toupper_tab_;