- Notifications
You must be signed in to change notification settings - Fork5
Commit60f11b8
committed
Use SASLprep to normalize passwords for SCRAM authentication.
An important step of SASLprep normalization, is to convert the string toUnicode normalization form NFKC. Unicode normalization requires a fairlylarge table of character decompositions, which is generated from datapublished by the Unicode consortium. The script to generate the table isput in src/common/unicode, as well test code for the normalization.A pre-generated version of the tables is included in src/include/common,so you don't need the code in src/common/unicode to build PostgreSQL, onlyif you wish to modify the normalization tables.The SASLprep implementation depends on the UTF-8 functions fromsrc/backend/utils/mb/wchar.c. So to use it, you must also compile and linkthat. That doesn't change anything for the current users of thesefunctions, the backend and libpq, as they both already link with wchar.o.It would be good to move those functions into a separate file insrc/commmon, but I'll leave that for another day.No documentation changes included, because there is no details on theSCRAM mechanism in the docs anyway. An overview on that in the protocolspecification would probably be good, even though SCRAM is documented indetail in RFC5802. I'll write that as a separate patch. An important thingto mention there is that we apply SASLprep even on invalid UTF-8 strings,to support other encodings.Patch by Michael Paquier and me.Discussion:https://www.postgresql.org/message-id/CAB7nPqSByyEmAVLtEf1KxTRh=PWNKiWKEKQR=e1yGehz=wbymQ@mail.gmail.com1 parent32e33a7 commit60f11b8
File tree
19 files changed
+11322
-32
lines changed- src
- backend/libpq
- common
- unicode
- include/common
- interfaces/libpq
- test/authentication/t
- tools/msvc
19 files changed
+11322
-32
lines changedLines changed: 59 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
14 |
| - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 |
| |
16 | 20 |
| |
| 21 | + | |
17 | 22 |
| |
18 | 23 |
| |
19 | 24 |
| |
20 |
| - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
21 | 51 |
| |
22 | 52 |
| |
23 | 53 |
| |
| |||
37 | 67 |
| |
38 | 68 |
| |
39 | 69 |
| |
| 70 | + | |
40 | 71 |
| |
41 | 72 |
| |
42 | 73 |
| |
| |||
52 | 83 |
| |
53 | 84 |
| |
54 | 85 |
| |
| 86 | + | |
55 | 87 |
| |
56 | 88 |
| |
57 | 89 |
| |
| |||
344 | 376 |
| |
345 | 377 |
| |
346 | 378 |
| |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
347 | 390 |
| |
348 | 391 |
| |
349 | 392 |
| |
| |||
373 | 416 |
| |
374 | 417 |
| |
375 | 418 |
| |
| 419 | + | |
| 420 | + | |
| 421 | + | |
376 | 422 |
| |
377 | 423 |
| |
378 | 424 |
| |
| |||
392 | 438 |
| |
393 | 439 |
| |
394 | 440 |
| |
| 441 | + | |
| 442 | + | |
395 | 443 |
| |
396 | 444 |
| |
397 | 445 |
| |
398 | 446 |
| |
399 | 447 |
| |
400 |
| - | |
401 |
| - | |
| 448 | + | |
402 | 449 |
| |
403 | 450 |
| |
404 | 451 |
| |
| |||
412 | 459 |
| |
413 | 460 |
| |
414 | 461 |
| |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
415 | 467 |
| |
416 | 468 |
| |
417 | 469 |
| |
418 | 470 |
| |
| 471 | + | |
| 472 | + | |
| 473 | + | |
419 | 474 |
| |
420 | 475 |
| |
421 | 476 |
| |
|
Lines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
45 |
| - | |
| 45 | + | |
| 46 | + | |
46 | 47 |
| |
47 | 48 |
| |
48 | 49 |
| |
|
0 commit comments
Comments
(0)