forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitb577743
committed
Make SCRAM iteration count configurable
Replace the hardcoded value with a GUC such that the iterationcount can be raised in order to increase protection againstbrute-force attacks. The hardcoded value for SCRAM iterationcount was defined to be 4096, which is taken from RFC 7677, soset the default for the GUC to 4096 to match. In RFC 7677 therecommendation is at least 15000 iterations but 4096 is listedas a SHOULD requirement given that it's estimated to yield a0.5s processing time on a mobile handset of the time of RFCwriting (late 2015).Raising the iteration count of SCRAM will make stored passwordsmore resilient to brute-force attacks at a higher computationalcost during connection establishment. Lowering the count willreduce computational overhead during connections at the tradeoffof reducing strength against brute-force attacks.There are however platforms where even a modest iteration countyields a too high computational overhead, with weaker passwordencryption schemes chosen as a result. In these situations,SCRAM with a very low iteration count still gives benefits overweaker schemes like md5, so we allow the iteration count to beset to one at the low end.The new GUC is intentionally generically named such that it canbe made to support future SCRAM standards should they emerge.At that point the value can be made into key:value pairs withan undefined key as a default which will be backwards compatiblewith this.Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Jonathan S. Katz <jkatz@postgresql.org>Discussion:https://postgr.es/m/F72E7BC7-189F-4B17-BF47-9735EB72C364@yesql.se1 parentc15631f commitb577743
File tree
16 files changed
+94
-10
lines changed- doc/src/sgml
- src
- backend
- libpq
- utils/misc
- common
- include
- common
- libpq
- interfaces/libpq
- test
- authentication/t
- regress
- expected
- sql
16 files changed
+94
-10
lines changedLines changed: 20 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1132 | 1132 |
| |
1133 | 1133 |
| |
1134 | 1134 |
| |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
1135 | 1155 |
| |
1136 | 1156 |
| |
1137 | 1157 |
| |
|
Lines changed: 7 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
191 | 191 |
| |
192 | 192 |
| |
193 | 193 |
| |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
194 | 199 |
| |
195 | 200 |
| |
196 | 201 |
| |
| |||
496 | 501 |
| |
497 | 502 |
| |
498 | 503 |
| |
499 |
| - | |
| 504 | + | |
500 | 505 |
| |
501 | 506 |
| |
502 | 507 |
| |
| |||
717 | 722 |
| |
718 | 723 |
| |
719 | 724 |
| |
720 |
| - | |
| 725 | + | |
721 | 726 |
| |
722 | 727 |
| |
723 | 728 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
41 | 41 |
| |
42 | 42 |
| |
43 | 43 |
| |
| 44 | + | |
44 | 45 |
| |
45 | 46 |
| |
46 | 47 |
| |
| 48 | + | |
47 | 49 |
| |
48 | 50 |
| |
49 | 51 |
| |
| |||
3468 | 3470 |
| |
3469 | 3471 |
| |
3470 | 3472 |
| |
| 3473 | + | |
| 3474 | + | |
| 3475 | + | |
| 3476 | + | |
| 3477 | + | |
| 3478 | + | |
| 3479 | + | |
| 3480 | + | |
| 3481 | + | |
| 3482 | + | |
| 3483 | + | |
3471 | 3484 |
| |
3472 | 3485 |
| |
3473 | 3486 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
| 98 | + | |
98 | 99 |
| |
99 | 100 |
| |
100 | 101 |
| |
|
Lines changed: 1 addition & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
214 | 214 |
| |
215 | 215 |
| |
216 | 216 |
| |
217 |
| - | |
218 |
| - | |
| 217 | + | |
219 | 218 |
| |
220 | 219 |
| |
221 | 220 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
47 | 47 |
| |
48 | 48 |
| |
49 | 49 |
| |
50 |
| - | |
| 50 | + | |
51 | 51 |
| |
52 | 52 |
| |
53 | 53 |
| |
|
Lines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
18 | 18 |
| |
19 | 19 |
| |
20 | 20 |
| |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 |
| |
22 | 25 |
| |
23 | 26 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
895 | 895 |
| |
896 | 896 |
| |
897 | 897 |
| |
898 |
| - | |
| 898 | + | |
899 | 899 |
| |
900 | 900 |
| |
901 | 901 |
| |
| |||
927 | 927 |
| |
928 | 928 |
| |
929 | 929 |
| |
930 |
| - | |
| 930 | + | |
931 | 931 |
| |
932 | 932 |
| |
933 | 933 |
| |
|
Lines changed: 3 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1341 | 1341 |
| |
1342 | 1342 |
| |
1343 | 1343 |
| |
1344 |
| - | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
1345 | 1347 |
| |
1346 | 1348 |
| |
1347 | 1349 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
26 | 26 |
| |
27 | 27 |
| |
28 | 28 |
| |
| 29 | + | |
29 | 30 |
| |
30 | 31 |
| |
31 | 32 |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
596 | 596 |
| |
597 | 597 |
| |
598 | 598 |
| |
| 599 | + | |
599 | 600 |
| |
600 | 601 |
| |
601 | 602 |
| |
| |||
4182 | 4183 |
| |
4183 | 4184 |
| |
4184 | 4185 |
| |
| 4186 | + | |
4185 | 4187 |
| |
4186 | 4188 |
| |
4187 | 4189 |
| |
|
Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1181 | 1181 |
| |
1182 | 1182 |
| |
1183 | 1183 |
| |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
1184 | 1188 |
| |
1185 | 1189 |
| |
1186 | 1190 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
525 | 525 |
| |
526 | 526 |
| |
527 | 527 |
| |
| 528 | + | |
528 | 529 |
| |
529 | 530 |
| |
530 | 531 |
| |
|
Lines changed: 24 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
86 | 86 |
| |
87 | 87 |
| |
88 | 88 |
| |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
89 | 104 |
| |
90 | 105 |
| |
91 | 106 |
| |
| |||
98 | 113 |
| |
99 | 114 |
| |
100 | 115 |
| |
101 |
| - | |
| 116 | + | |
102 | 117 |
| |
103 | 118 |
| |
104 | 119 |
| |
| |||
283 | 298 |
| |
284 | 299 |
| |
285 | 300 |
| |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
286 | 309 |
| |
287 | 310 |
| |
288 | 311 |
| |
|
Lines changed: 6 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
72 | 72 |
| |
73 | 73 |
| |
74 | 74 |
| |
| 75 | + | |
| 76 | + | |
| 77 | + | |
75 | 78 |
| |
76 | 79 |
| |
77 | 80 |
| |
| |||
86 | 89 |
| |
87 | 90 |
| |
88 | 91 |
| |
89 |
| - | |
| 92 | + | |
| 93 | + | |
90 | 94 |
| |
91 | 95 |
| |
92 | 96 |
| |
| |||
129 | 133 |
| |
130 | 134 |
| |
131 | 135 |
| |
| 136 | + | |
132 | 137 |
| |
133 | 138 |
| |
134 | 139 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
63 | 63 |
| |
64 | 64 |
| |
65 | 65 |
| |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
66 | 70 |
| |
67 | 71 |
| |
68 | 72 |
| |
| |||
97 | 101 |
| |
98 | 102 |
| |
99 | 103 |
| |
| 104 | + | |
100 | 105 |
| |
101 | 106 |
| |
102 | 107 |
| |
|
0 commit comments
Comments
(0)