diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-12-13 22:59:31 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-12-13 22:59:31 +0100 |
commit | 74f7872f89dc8ecad500c5d5c4e03b4757f6418d (patch) | |
tree | 7b9f8a573c50009c9ad42a653fec8fac94557e1b /winsup/cygwin/miscfuncs.cc | |
parent | 80f4987f02e50721e4cc62f6d70bc602324d32ad (diff) | |
download | newlib-74f7872f89dc8ecad500c5d5c4e03b4757f6418d.zip newlib-74f7872f89dc8ecad500c5d5c4e03b4757f6418d.tar.gz newlib-74f7872f89dc8ecad500c5d5c4e03b4757f6418d.tar.bz2 |
Rearrange RNG code slightly
In preparation of exporting getentropy/getrandom to userspace, rearrange
code a bit:
- Define RtlGenRandom in ntdll.h.
- Drop calls to getentropy in favor of RtlGenRandom (fhandler_socket,
fhandler_dev_random).
- Add try/except blocks in fhandler_dev_random to return EFAULT rather
than crashing if buffer pointer is invalid.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/miscfuncs.cc')
-rw-r--r-- | winsup/cygwin/miscfuncs.cc | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/winsup/cygwin/miscfuncs.cc b/winsup/cygwin/miscfuncs.cc index f90d6ef..0b19b28 100644 --- a/winsup/cygwin/miscfuncs.cc +++ b/winsup/cygwin/miscfuncs.cc @@ -233,12 +233,6 @@ check_iovec (const struct iovec *iov, int iovcnt, bool forwrite) return -1; } -/* There's a bug in ntsecapi.h (Mingw as well as MSFT). SystemFunction036 - is, in fact, a WINAPI function, but it's not defined as such. Therefore - we have to do it correctly here. */ -#define RtlGenRandom SystemFunction036 -extern "C" BOOLEAN WINAPI RtlGenRandom (PVOID, ULONG); - /* Used by arc2random, fhandler_socket and fhandler_random. */ extern "C" int getentropy (void *ptr, size_t len) |