- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit7f56d43
committed
Fix detection of passwords hashed with MD5 or SCRAM-SHA-256
This commit fixes a couple of issues related to the way passwordverifiers hashed with MD5 or SCRAM-SHA-256 are detected, leading tobeing able to store in catalogs passwords which do not follow thesupported hash formats:- A MD5-hashed entry was checked based on if its header uses "md5" andif the string length matches what is expected. Unfortunately the codenever checked if the hash only used hexadecimal characters, as reportedby Tom Lane.- A SCRAM-hashed entry was checked based on only its header, whichshould be "SCRAM-SHA-256$", but it never checked for any fieldsafterwards, as reported by Jonathan Katz.Backpatch down to v10, which is where SCRAM has been introduced, andwhere password verifiers in plain format have been removed.Author: Jonathan KatzReviewed-by: Tom Lane, Michael PaquierDiscussion:https://postgr.es/m/016deb6b-1f0a-8e9f-1833-a8675b170aa9@postgresql.orgBackpatch-through: 101 parentcee3cfd commit7f56d43
File tree
6 files changed
+44
-6
lines changed- src
- backend/libpq
- include
- common
- libpq
- test/regress
- expected
- sql
6 files changed
+44
-6
lines changedLines changed: 1 addition & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
162 | 162 |
| |
163 | 163 |
| |
164 | 164 |
| |
165 |
| - | |
166 |
| - | |
167 | 165 |
| |
168 | 166 |
| |
169 | 167 |
| |
| |||
547 | 545 |
| |
548 | 546 |
| |
549 | 547 |
| |
550 |
| - | |
| 548 | + | |
551 | 549 |
| |
552 | 550 |
| |
553 | 551 |
| |
|
Lines changed: 11 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
90 | 91 |
| |
91 | 92 |
| |
92 | 93 |
| |
93 |
| - | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
94 | 102 |
| |
95 |
| - | |
| 103 | + | |
| 104 | + | |
96 | 105 |
| |
97 | 106 |
| |
98 | 107 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16 | 16 |
| |
17 | 17 |
| |
18 | 18 |
| |
| 19 | + | |
19 | 20 |
| |
20 | 21 |
| |
21 | 22 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
| 32 | + | |
| 33 | + | |
32 | 34 |
| |
33 | 35 |
| |
34 | 36 |
| |
|
Lines changed: 16 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
62 | 62 |
| |
63 | 63 |
| |
64 | 64 |
| |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
65 | 74 |
| |
66 | 75 |
| |
67 | 76 |
| |
| |||
73 | 82 |
| |
74 | 83 |
| |
75 | 84 |
| |
76 |
| - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
77 | 89 |
| |
78 | 90 |
| |
79 | 91 |
| |
| |||
93 | 105 |
| |
94 | 106 |
| |
95 | 107 |
| |
| 108 | + | |
| 109 | + | |
| 110 | + | |
96 | 111 |
| |
97 | 112 |
| |
98 | 113 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
54 | 54 |
| |
55 | 55 |
| |
56 | 56 |
| |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
57 | 67 |
| |
58 | 68 |
| |
59 | 69 |
| |
| |||
70 | 80 |
| |
71 | 81 |
| |
72 | 82 |
| |
| 83 | + | |
| 84 | + | |
| 85 | + | |
73 | 86 |
| |
74 | 87 |
| |
75 | 88 |
| |
|
0 commit comments
Comments
(0)