forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9e083fd
committed
Replace PostmasterRandom() with a stronger way of generating randomness.
This adds a new routine, pg_strong_random() for generating random bytes,for use in both frontend and backend. At the moment, it's only used inthe backend, but the upcoming SCRAM authentication patches need strongrandom numbers in libpq as well.pg_strong_random() is based on, and replaces, the existing implementationin pgcrypto. It can acquire strong random numbers from a number of sources,depending on what's available:- OpenSSL RAND_bytes(), if built with OpenSSL- On Windows, the native cryptographic functions are used- /dev/urandom- /dev/randomOriginal patch by Magnus Hagander, with further work by Michael Paquierand me.Discussion: <CAB7nPqRy3krN8quR9XujMVVHYtXJ0_60nqgVc6oUk8ygyVkZsA@mail.gmail.com>1 parent5dfc198 commit9e083fd
File tree
9 files changed
+244
-384
lines changed- contrib/pgcrypto
- src
- backend
- libpq
- postmaster
- include
- port
- tools/msvc
9 files changed
+244
-384
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
4 |
| - | |
| 4 | + | |
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
626 | 626 |
| |
627 | 627 |
| |
628 | 628 |
| |
629 |
| - | |
630 |
| - | |
631 | 629 |
| |
632 | 630 |
| |
633 | 631 |
| |
| |||
642 | 640 |
| |
643 | 641 |
| |
644 | 642 |
| |
| 643 | + | |
| 644 | + | |
645 | 645 |
| |
646 | 646 |
| |
647 | 647 |
| |
648 |
| - | |
649 |
| - | |
650 |
| - | |
651 |
| - | |
652 |
| - | |
653 |
| - | |
654 |
| - | |
655 |
| - | |
656 |
| - | |
657 |
| - | |
658 |
| - | |
659 |
| - | |
| 648 | + | |
| 649 | + | |
660 | 650 |
| |
661 |
| - | |
662 |
| - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
663 | 671 |
| |
664 | 672 |
| |
665 | 673 |
| |
|
This file was deleted.
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
45 | 45 |
| |
46 | 46 |
| |
47 | 47 |
| |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
48 | 54 |
| |
49 | 55 |
| |
50 | 56 |
| |
| |||
535 | 541 |
| |
536 | 542 |
| |
537 | 543 |
| |
538 |
| - | |
539 |
| - | |
540 |
| - | |
| 544 | + | |
541 | 545 |
| |
542 | 546 |
| |
543 | 547 |
| |
| |||
692 | 696 |
| |
693 | 697 |
| |
694 | 698 |
| |
695 |
| - | |
| 699 | + | |
696 | 700 |
| |
697 | 701 |
| |
698 | 702 |
| |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
699 | 718 |
| |
700 | 719 |
| |
701 | 720 |
| |
|
0 commit comments
Comments
(0)