forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit44bd012
committed
Add more sanity checks in SASL exchanges
The following checks are added, to make the SASL infrastructure moreaware of defects when implementing new mechanisms:- Detect that no output is generated by a mechanism if an exchange failsin the backend, failing if there is a message waiting to be sent.- Handle zero-length messages in the frontend. The backend handles thatalready, and SCRAM would complain if sending empty messages as this isnot authorized for this mechanism, but other mechanisms may want thiscapability (the SASL specification allows that).- Make sure that a mechanism generates a message in the middle of theexchange in the frontend.SCRAM, as implemented, respects all these requirements already, and therecent refactoring of SASL done in9fd8557 helps in documenting that ina cleaner way.Analyzed-by: Jacob ChampionAuthor: Michael PaquierReviewed-by: Jacob ChampionDiscussion:https://postgr.es/m/3d2a6f5d50e741117d6baf83eb67ebf1a8a35a11.camel@vmware.com1 parente7fc488 commit44bd012
File tree
3 files changed
+28
-5
lines changed- src
- backend/libpq
- interfaces/libpq
3 files changed
+28
-5
lines changedLines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
171 | 171 |
| |
172 | 172 |
| |
173 | 173 |
| |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
174 | 181 |
| |
175 | 182 |
| |
176 | 183 |
| |
|
Lines changed: 5 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
78 | 78 |
| |
79 | 79 |
| |
80 | 80 |
| |
81 |
| - | |
82 |
| - | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
83 | 84 |
| |
84 |
| - | |
85 |
| - | |
| 85 | + | |
| 86 | + | |
86 | 87 |
| |
87 | 88 |
| |
88 | 89 |
| |
|
Lines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
674 | 674 |
| |
675 | 675 |
| |
676 | 676 |
| |
677 |
| - | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
678 | 693 |
| |
679 | 694 |
| |
680 | 695 |
| |
|
0 commit comments
Comments
(0)