- Notifications
You must be signed in to change notification settings - Fork28
Commit818fd4a
committed
Support SCRAM-SHA-256 authentication (RFC 5802 and 7677).
This introduces a new generic SASL authentication method, similar to theGSS and SSPI methods. The server first tells the client which SASLauthentication mechanism to use, and then the mechanism-specific SASLmessages are exchanged in AuthenticationSASLcontinue and PasswordMessagemessages. Only SCRAM-SHA-256 is supported at the moment, but this allowsadding more SASL mechanisms in the future, without changing the overallprotocol.Support for channel binding, aka SCRAM-SHA-256-PLUS is left for later.The SASLPrep algorithm, for pre-processing the password, is not yetimplemented. That could cause trouble, if you use a password withnon-ASCII characters, and a client library that does implement SASLprep.That will hopefully be added later.Authorization identities, as specified in the SCRAM-SHA-256 specification,are ignored. SET SESSION AUTHORIZATION provides more or less the samefunctionality, anyway.If a user doesn't exist, perform a "mock" authentication, by constructingan authentic-looking challenge on the fly. The challenge is derived froma new system-wide random value, "mock authentication nonce", which iscreated at initdb, and stored in the control file. We go through thesemotions, in order to not give away the information on whether the userexists, to unauthenticated users.Bumps PG_CONTROL_VERSION, because of the new field in control file.Patch by Michael Paquier and Heikki Linnakangas, reviewed at differentstages by Robert Haas, Stephen Frost, David Steele, Aleksander Alekseev,and many others.Discussion:https://www.postgresql.org/message-id/CAB7nPqRbR3GmFYdedCAhzukfKrgBLTLtMvENOmPrVWREsZkF8g%40mail.gmail.comDiscussion:https://www.postgresql.org/message-id/CAB7nPqSMXU35g%3DW9X74HVeQp0uvgJxvYOuA4A-A3M%2B0wfEBv-w%40mail.gmail.comDiscussion:https://www.postgresql.org/message-id/55192AFE.6080106@iki.fi1 parent273c458 commit818fd4a
File tree
38 files changed
+2866
-77
lines changed- contrib/pgcrypto
- doc/src/sgml
- ref
- src
- backend
- access/transam
- commands
- libpq
- utils/misc
- bin
- initdb
- pg_controldata
- common
- include
- access
- catalog
- common
- libpq
- interfaces/libpq
- tools/msvc
38 files changed
+2866
-77
lines changedLines changed: 0 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 |
| - | |
2 |
| - | |
3 |
| - | |
4 |
| - | |
5 | 1 |
| |
6 | 2 |
| |
7 | 3 |
| |
|
Lines changed: 2 additions & 9 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 |
| - | |
| 3 | + | |
4 | 4 |
| |
5 | 5 |
| |
6 | 6 |
| |
7 |
| - | |
| 7 | + | |
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
| |||
59 | 59 |
| |
60 | 60 |
| |
61 | 61 |
| |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
67 |
| - | |
68 |
| - | |
69 | 62 |
| |
70 | 63 |
| |
71 | 64 |
| |
|
Lines changed: 17 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1334 | 1334 |
| |
1335 | 1335 |
| |
1336 | 1336 |
| |
1337 |
| - | |
1338 |
| - | |
1339 |
| - | |
1340 |
| - | |
1341 |
| - | |
1342 |
| - | |
1343 |
| - | |
1344 |
| - | |
| 1337 | + | |
| 1338 | + | |
1345 | 1339 |
| |
1346 | 1340 |
| |
1347 | 1341 |
| |
| |||
1355 | 1349 |
| |
1356 | 1350 |
| |
1357 | 1351 |
| |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
1358 | 1367 |
| |
1359 | 1368 |
| |
1360 | 1369 |
| |
|
Lines changed: 46 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
422 | 422 |
| |
423 | 423 |
| |
424 | 424 |
| |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
425 | 436 |
| |
426 | 437 |
| |
427 | 438 |
| |
| |||
673 | 684 |
| |
674 | 685 |
| |
675 | 686 |
| |
676 |
| - | |
| 687 | + | |
677 | 688 |
| |
678 | 689 |
| |
679 | 690 |
| |
680 | 691 |
| |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
681 | 697 |
| |
682 |
| - | |
| 698 | + | |
| 699 | + | |
683 | 700 |
| |
684 | 701 |
| |
685 | 702 |
| |
| |||
907 | 924 |
| |
908 | 925 |
| |
909 | 926 |
| |
910 |
| - | |
911 |
| - | |
| 927 | + | |
| 928 | + | |
912 | 929 |
| |
913 |
| - | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
914 | 949 |
| |
915 | 950 |
| |
916 | 951 |
| |
917 |
| - | |
918 |
| - | |
919 |
| - | |
920 |
| - | |
921 |
| - | |
922 |
| - | |
923 |
| - | |
924 |
| - | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
925 | 958 |
| |
926 | 959 |
| |
927 | 960 |
| |
|
Lines changed: 4 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1193 | 1193 |
| |
1194 | 1194 |
| |
1195 | 1195 |
| |
1196 |
| - | |
1197 |
| - | |
1198 |
| - | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
1199 | 1200 |
| |
1200 | 1201 |
| |
1201 | 1202 |
| |
|
Lines changed: 142 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
228 | 228 |
| |
229 | 229 |
| |
230 | 230 |
| |
231 |
| - | |
232 |
| - | |
| 231 | + | |
| 232 | + | |
233 | 233 |
| |
234 |
| - | |
235 |
| - | |
| 234 | + | |
| 235 | + | |
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
| |||
366 | 366 |
| |
367 | 367 |
| |
368 | 368 |
| |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
369 | 398 |
| |
370 | 399 |
| |
371 | 400 |
| |
| |||
2782 | 2811 |
| |
2783 | 2812 |
| |
2784 | 2813 |
| |
| 2814 | + | |
| 2815 | + | |
| 2816 | + | |
| 2817 | + | |
| 2818 | + | |
| 2819 | + | |
| 2820 | + | |
| 2821 | + | |
| 2822 | + | |
| 2823 | + | |
| 2824 | + | |
| 2825 | + | |
| 2826 | + | |
| 2827 | + | |
| 2828 | + | |
| 2829 | + | |
| 2830 | + | |
| 2831 | + | |
| 2832 | + | |
| 2833 | + | |
| 2834 | + | |
| 2835 | + | |
| 2836 | + | |
| 2837 | + | |
| 2838 | + | |
| 2839 | + | |
| 2840 | + | |
| 2841 | + | |
| 2842 | + | |
| 2843 | + | |
| 2844 | + | |
| 2845 | + | |
| 2846 | + | |
| 2847 | + | |
| 2848 | + | |
| 2849 | + | |
| 2850 | + | |
| 2851 | + | |
| 2852 | + | |
| 2853 | + | |
| 2854 | + | |
| 2855 | + | |
| 2856 | + | |
| 2857 | + | |
| 2858 | + | |
| 2859 | + | |
| 2860 | + | |
| 2861 | + | |
| 2862 | + | |
| 2863 | + | |
| 2864 | + | |
| 2865 | + | |
| 2866 | + | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
| 2872 | + | |
| 2873 | + | |
| 2874 | + | |
| 2875 | + | |
| 2876 | + | |
| 2877 | + | |
| 2878 | + | |
| 2879 | + | |
| 2880 | + | |
| 2881 | + | |
| 2882 | + | |
| 2883 | + | |
| 2884 | + | |
| 2885 | + | |
| 2886 | + | |
| 2887 | + | |
| 2888 | + | |
| 2889 | + | |
| 2890 | + | |
| 2891 | + | |
| 2892 | + | |
| 2893 | + | |
| 2894 | + | |
| 2895 | + | |
| 2896 | + | |
| 2897 | + | |
| 2898 | + | |
| 2899 | + | |
| 2900 | + | |
| 2901 | + | |
| 2902 | + | |
| 2903 | + | |
| 2904 | + | |
| 2905 | + | |
| 2906 | + | |
| 2907 | + | |
| 2908 | + | |
| 2909 | + | |
| 2910 | + | |
| 2911 | + | |
| 2912 | + | |
| 2913 | + | |
| 2914 | + | |
| 2915 | + | |
| 2916 | + | |
| 2917 | + | |
| 2918 | + | |
| 2919 | + | |
| 2920 | + | |
| 2921 | + | |
2785 | 2922 |
| |
2786 | 2923 |
| |
2787 | 2924 |
| |
| |||
4544 | 4681 |
| |
4545 | 4682 |
| |
4546 | 4683 |
| |
4547 |
| - | |
| 4684 | + | |
4548 | 4685 |
| |
4549 | 4686 |
| |
4550 | 4687 |
| |
|
Lines changed: 11 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
231 | 231 |
| |
232 | 232 |
| |
233 | 233 |
| |
234 |
| - | |
235 |
| - | |
236 |
| - | |
237 |
| - | |
238 |
| - | |
239 |
| - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
240 | 245 |
| |
241 | 246 |
| |
242 | 247 |
| |
|
0 commit comments
Comments
(0)