[php-src] PR #13761: random: Simplify implementation of php_random_generate_fallback_seed()
| From: | TimWolla | Date: | Tue, 19 Mar 2024 19:24:40 +0000 |
| Subject: | [php-src] PR #13761: random: Simplify implementation of php_random_generate_fallback_seed() | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-25485@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/13761
Author: TimWolla
As all the input bits and pieces are mixed with SHA-1, cross-architecture compatibility is not
required and we can just mix in whatever they may look like in memory, instead of going through the
write_*() helpers that were created for a previous in-development version that first
filled a buffer that was then hashed (allowing for easy inspection of the input data, but making it
harder to safely add values without checking for buffer overflows all the time).
This change should also fix a build error on macOS ZTS: The thread ID is an opaque type and not
guaranteed to be arithmetic as per IEEE Std 1003.1-2017. And indeed macOS defines it as a pointer to
a structure, failing due to the implicit pointer to integer conversion.