Commit 6fb20cd
authored
random: Simplify implementation of php_random_generate_fallback_seed() (#13761)
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.1 parent 2e7c6e1 commit 6fb20cd
1 file changed
+28
-38
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
614 | 614 | | |
615 | 615 | | |
616 | 616 | | |
617 | | - | |
618 | | - | |
619 | | - | |
620 | | - | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
641 | 623 | | |
642 | 624 | | |
643 | 625 | | |
| |||
650 | 632 | | |
651 | 633 | | |
652 | 634 | | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
653 | 640 | | |
654 | 641 | | |
655 | 642 | | |
656 | 643 | | |
657 | 644 | | |
658 | 645 | | |
659 | | - | |
660 | | - | |
| 646 | + | |
661 | 647 | | |
662 | | - | |
| 648 | + | |
| 649 | + | |
663 | 650 | | |
664 | | - | |
| 651 | + | |
| 652 | + | |
665 | 653 | | |
666 | 654 | | |
667 | | - | |
| 655 | + | |
| 656 | + | |
668 | 657 | | |
669 | 658 | | |
670 | | - | |
671 | | - | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
672 | 663 | | |
673 | 664 | | |
674 | | - | |
| 665 | + | |
675 | 666 | | |
676 | 667 | | |
677 | 668 | | |
678 | | - | |
| 669 | + | |
679 | 670 | | |
680 | 671 | | |
681 | 672 | | |
682 | | - | |
| 673 | + | |
683 | 674 | | |
684 | 675 | | |
685 | 676 | | |
686 | | - | |
| 677 | + | |
687 | 678 | | |
688 | 679 | | |
689 | 680 | | |
690 | | - | |
691 | | - | |
| 681 | + | |
692 | 682 | | |
693 | | - | |
| 683 | + | |
694 | 684 | | |
695 | 685 | | |
696 | 686 | | |
| |||
0 commit comments