History log of /php-src/ext/random/csprng.c (Results 1 – 12 of 12)
Revision Date Author Comments
# d00dd2b4 28-Sep-2024 David Carlier

ext/random: haiku supports arc4random api too.

close GH-16095


# f1e5c638 13-Aug-2024 David Carlier

Checks getrandom availability on solaris.

To fix part of GH-15381.
gcc nor clang provides a constant to distinguish illumos and solaris
not the system provides a kernel version stamp

Checks getrandom availability on solaris.

To fix part of GH-15381.
gcc nor clang provides a constant to distinguish illumos and solaris
not the system provides a kernel version stamp like the BSD.
thus, we simply check the symbol and remaing purposely conservative in
the existing logic, using it only for solaris to avoid unexpected
breakages for other systems. would need a different fix for higher
branches.

Close GH-15390

show more ...


# 3b951e7b 13-Jun-2024 Peter Kokot

Rename HAVE_DECL_ARC4RANDOM_BUF to HAVE_ARC4RANDOM_BUF (#14565)

AC_CHECK_DECLS defines HAVE_DECL_ARC4RANDOM_BUF to 0 or 1. On Windows
this isn't defined to 0. To avoid the undefined stat

Rename HAVE_DECL_ARC4RANDOM_BUF to HAVE_ARC4RANDOM_BUF (#14565)

AC_CHECK_DECLS defines HAVE_DECL_ARC4RANDOM_BUF to 0 or 1. On Windows
this isn't defined to 0. To avoid the undefined state, the AC_CHECK_DECL
is used to manually define the HAVE_ARC4RANDOM_BUF to 1 if declaration
is found, otherwise undefined.

In the future on current platforms, also AC_CHECK_FUNCS can be used
instead since the arc4random_buf is located in default libraries (C)
with declaration available in headers.

show more ...


# 5d3fab93 11-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14520)

These are either undefined or defined (to value 1):
- __DragonFly__
- __FreeBSD__
- HAS_MCAST_EXT
- HAVE_GETCWD
- HAVE_GETWD
- HAVE_GL

Sync #if/ifdef/defined (#14520)

These are either undefined or defined (to value 1):
- __DragonFly__
- __FreeBSD__
- HAS_MCAST_EXT
- HAVE_GETCWD
- HAVE_GETWD
- HAVE_GLIBC_ICONV
- HAVE_JIT
- HAVE_LCHOWN
- HAVE_NL_LANGINFO
- HAVE_RL_CALLBACK_READ_CHAR
- HAVE_RL_ON_NEW_LINE
- HAVE_SQL_EXTENDED_FETCH
- HAVE_UTIME

Follow up of GH-5526 (-Wundef)

show more ...


# 84a0da15 09-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRE

Sync #if/ifdef/defined (#14508)

This syncs CPP macro conditions:
- _WIN32
- _WIN64
- HAVE_ALLOCA_H
- HAVE_ALPHASORT
- HAVE_ARPA_INET_H
- HAVE_CONFIG_H
- HAVE_DIRENT_H
- HAVE_DLFCN_H
- HAVE_GETTIMEOFDAY
- HAVE_LIBDL
- HAVE_POLL_H
- HAVE_PWD_H
- HAVE_SCANDIR
- HAVE_SYS_FILE_H
- HAVE_SYS_PARAM_H
- HAVE_SYS_SOCKET_H
- HAVE_SYS_TIME_H
- HAVE_SYS_TYPES_H
- HAVE_SYS_WAIT_H
- HAVE_UNISTD_H
- PHP_WIN32
- ZEND_WIN32

These are either undefined or defined to 1 in Autotools and Windows.

Follow up of GH-5526 (-Wundef).

show more ...


# da86eec3 07-Jun-2024 Peter Kokot

Sync #if/ifdef/defined (#14371)

These are either undefined or defined to value 1 in Autotools and
Windows:
- HAVE_COMMONCRYPTO_COMMONRANDOM_H
- HAVE_EXIF
- HAVE_FOPENCOOKIE

Sync #if/ifdef/defined (#14371)

These are either undefined or defined to value 1 in Autotools and
Windows:
- HAVE_COMMONCRYPTO_COMMONRANDOM_H
- HAVE_EXIF
- HAVE_FOPENCOOKIE
- HAVE_IF_NAMETOINDEX
- HAVE_LIBICONV
- HAVE_SOCKETS
- HAVE_STRUCT_STAT_ST_RDEV
- HAVE_STRUCT_TM_TM_GMTOFF
- HAVE_STRUCT_TM_TM_ZONE

Follow up of GH-5526 (-Wundef)

show more ...


# 44c199ce 30-May-2024 Arnaud Le Blanc

random: Make php_random_bytes() useable early during engine startup (#14291)

php_random_bytes() can now be used before RANDOM_G() is initialized


# ff76cb73 18-Apr-2024 Ørjan Malde

rudimentary midipix port (#13896)


# 97b3b455 01-Feb-2024 Tim Düsterhus

random: Move CSPRNG API into php_random_csprng.h (#13290)

This allows consumers of just the CSPRNG to include a much smaller header. It
also allows to verify at a glance whether a source

random: Move CSPRNG API into php_random_csprng.h (#13290)

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 to 45f8cfaf104f504340b0073b9736bb50a88d70a1,
2b30f18708b4f73d2c1d29d3a92a606ebdc5ac4c, and
b14dd85dca3b67a5462f5ed9b6aa0dc22beb615c.

show more ...


# d5484bf1 04-Apr-2023 Dmitry Stogov

Remove includes


# f079aa2e 24-Feb-2023 Tim Düsterhus

random: Fix return type of php_random_(bytes|int) (#10687)

These return a `zend_result`, not `int`.


# b14dd85d 23-Feb-2023 Tim Düsterhus

random: Move the CSPRNG implementation into a separate C file (#10668)

The CSPRNG is a delicate and security relevant piece of code and having it in
the giant random.c makes it much hard

random: Move the CSPRNG implementation into a separate C file (#10668)

The CSPRNG is a delicate and security relevant piece of code and having it in
the giant random.c makes it much harder to verify changes to it. Split it into
a separate file.

show more ...