mirror of
https://github.com/php/php-src.git
synced 2025-08-17 14:38:49 +02:00

This allows consumers of just the CSPRNG to include a much smaller header. It also allows to verify at a glance whether a source file might use non-secure randomness. This commit includes the new header wherever the CSPRNG is used, possibly replacing the inclusion of php_random.h if nothing else is used, but also includes it in the main php_random.h header for compatibility. Somewhat related to45f8cfaf10
,2b30f18708
, andb14dd85dca
.
32 lines
772 B
Text
32 lines
772 B
Text
dnl
|
|
dnl Check for arc4random on BSD systems
|
|
dnl
|
|
AC_CHECK_DECLS([arc4random_buf])
|
|
|
|
dnl
|
|
dnl Check for CCRandomGenerateBytes
|
|
dnl header absent in previous macOs releases
|
|
dnl
|
|
AC_CHECK_HEADERS([CommonCrypto/CommonRandom.h], [], [],
|
|
[
|
|
#include <sys/types.h>
|
|
#include <Availability.h>
|
|
#include <CommonCrypto/CommonCryptoError.h>
|
|
])
|
|
|
|
dnl
|
|
dnl Setup extension
|
|
dnl
|
|
PHP_NEW_EXTENSION(random,
|
|
random.c \
|
|
csprng.c \
|
|
engine_combinedlcg.c \
|
|
engine_mt19937.c \
|
|
engine_pcgoneseq128xslrr64.c \
|
|
engine_xoshiro256starstar.c \
|
|
engine_secure.c \
|
|
engine_user.c \
|
|
gammasection.c \
|
|
randomizer.c,
|
|
no,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
|
|
PHP_INSTALL_HEADERS([ext/random], [php_random.h php_random_csprng.h php_random_uint128.h])
|