mirror of
https://github.com/php/php-src.git
synced 2024-11-30 21:35:36 +08:00
Use arc4random_buf on macOS
macOS uses an AES based arc4random_buf implementation since at least macOS 10.2. Closes GH-6591.
This commit is contained in:
parent
973138f39d
commit
7a049cd6a4
@ -94,7 +94,7 @@ PHPAPI int php_random_bytes(void *bytes, size_t size, zend_bool should_throw)
|
||||
}
|
||||
return FAILURE;
|
||||
}
|
||||
#elif HAVE_DECL_ARC4RANDOM_BUF && ((defined(__OpenBSD__) && OpenBSD >= 201405) || (defined(__NetBSD__) && __NetBSD_Version__ >= 700000001))
|
||||
#elif HAVE_DECL_ARC4RANDOM_BUF && ((defined(__OpenBSD__) && OpenBSD >= 201405) || (defined(__NetBSD__) && __NetBSD_Version__ >= 700000001) || defined(__APPLE__))
|
||||
arc4random_buf(bytes, size);
|
||||
#else
|
||||
size_t read_bytes = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user