forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4f48a6f
committed
Change SHA2 implementation based on OpenSSL to use EVP digest routines
The use of low-level hash routines is not recommended by upstreamOpenSSL since 2000, and pgcrypto already switched to EVP as of5ff4a67.This takes advantage of the refactoring done in87ae969 that hasintroduced the allocation and free routines for cryptographic hashes.Since 1.1.0, OpenSSL does not publish the contents of the cryptohashcontexts, forcing any consumers to rely on OpenSSL for all allocations.Hence, the resource owner callback mechanism gains a new set of routinesto track and free cryptohash contexts when using OpenSSL, preventing anyrisks of leaks in the backend. Nothing is needed in the frontend thanksto the refactoring of87ae969, and the resowner knowledge is isolatedinto cryptohash_openssl.c.Note that this also fixes a failure with SCRAM authentication when usingFIPS in OpenSSL, but as there have been few complaints about thisproblem and as this causes an ABI breakage, no backpatch is done.Author: Michael PaquierReviewed-by: Daniel Gustafsson, Heikki LinnakangasDiscussion:https://postgr.es/m/20200924025314.GE7405@paquier.xyzDiscussion:https://postgr.es/m/20180911030250.GA27115@paquier.xyz1 parent3f8971d commit4f48a6f
File tree
5 files changed
+157
-49
lines changed- src
- backend
- replication
- utils/resowner
- common
- include/utils
- tools/pgindent
5 files changed
+157
-49
lines changedLines changed: 7 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
729 | 729 |
| |
730 | 730 |
| |
731 | 731 |
| |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
732 | 739 |
| |
733 | 740 |
| |
734 | 741 |
| |
735 | 742 |
| |
736 |
| - | |
737 | 743 |
| |
738 | 744 |
| |
739 | 745 |
| |
|
Lines changed: 62 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
20 | 20 |
| |
21 | 21 |
| |
22 | 22 |
| |
| 23 | + | |
23 | 24 |
| |
24 | 25 |
| |
25 | 26 |
| |
| |||
128 | 129 |
| |
129 | 130 |
| |
130 | 131 |
| |
| 132 | + | |
131 | 133 |
| |
132 | 134 |
| |
133 | 135 |
| |
| |||
175 | 177 |
| |
176 | 178 |
| |
177 | 179 |
| |
| 180 | + | |
178 | 181 |
| |
179 | 182 |
| |
180 | 183 |
| |
| |||
444 | 447 |
| |
445 | 448 |
| |
446 | 449 |
| |
| 450 | + | |
447 | 451 |
| |
448 | 452 |
| |
449 | 453 |
| |
| |||
553 | 557 |
| |
554 | 558 |
| |
555 | 559 |
| |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
556 | 571 |
| |
557 | 572 |
| |
558 | 573 |
| |
| |||
725 | 740 |
| |
726 | 741 |
| |
727 | 742 |
| |
| 743 | + | |
728 | 744 |
| |
729 | 745 |
| |
730 | 746 |
| |
| |||
752 | 768 |
| |
753 | 769 |
| |
754 | 770 |
| |
| 771 | + | |
755 | 772 |
| |
756 | 773 |
| |
757 | 774 |
| |
| |||
1370 | 1387 |
| |
1371 | 1388 |
| |
1372 | 1389 |
| |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + |
Lines changed: 80 additions & 48 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
21 | 21 |
| |
22 | 22 |
| |
23 | 23 |
| |
24 |
| - | |
| 24 | + | |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 |
| |
28 | 33 |
| |
29 | 34 |
| |
| |||
37 | 42 |
| |
38 | 43 |
| |
39 | 44 |
| |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
40 | 60 |
| |
41 | 61 |
| |
42 | 62 |
| |
| |||
47 | 67 |
| |
48 | 68 |
| |
49 | 69 |
| |
| 70 | + | |
50 | 71 |
| |
51 | 72 |
| |
52 | 73 |
| |
53 | 74 |
| |
54 | 75 |
| |
55 |
| - | |
56 |
| - | |
57 |
| - | |
| 76 | + | |
| 77 | + | |
58 | 78 |
| |
59 |
| - | |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
64 |
| - | |
65 |
| - | |
66 |
| - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
67 | 82 |
| |
68 | 83 |
| |
69 |
| - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
70 | 97 |
| |
| 98 | + | |
71 | 99 |
| |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
72 | 106 |
| |
73 | 107 |
| |
| 108 | + | |
74 | 109 |
| |
75 | 110 |
| |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
76 | 117 |
| |
77 | 118 |
| |
78 | 119 |
| |
| |||
85 | 126 |
| |
86 | 127 |
| |
87 | 128 |
| |
| 129 | + | |
88 | 130 |
| |
89 | 131 |
| |
90 | 132 |
| |
91 | 133 |
| |
| 134 | + | |
| 135 | + | |
92 | 136 |
| |
93 | 137 |
| |
94 | 138 |
| |
95 |
| - | |
| 139 | + | |
96 | 140 |
| |
97 | 141 |
| |
98 |
| - | |
| 142 | + | |
99 | 143 |
| |
100 | 144 |
| |
101 |
| - | |
| 145 | + | |
102 | 146 |
| |
103 | 147 |
| |
104 |
| - | |
| 148 | + | |
105 | 149 |
| |
106 | 150 |
| |
107 | 151 |
| |
| |||
120 | 164 |
| |
121 | 165 |
| |
122 | 166 |
| |
| 167 | + | |
123 | 168 |
| |
124 | 169 |
| |
125 | 170 |
| |
126 | 171 |
| |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
133 |
| - | |
134 |
| - | |
135 |
| - | |
136 |
| - | |
137 |
| - | |
138 |
| - | |
139 |
| - | |
140 |
| - | |
141 |
| - | |
| 172 | + | |
| 173 | + | |
142 | 174 |
| |
143 | 175 |
| |
144 | 176 |
| |
| |||
155 | 187 |
| |
156 | 188 |
| |
157 | 189 |
| |
| 190 | + | |
158 | 191 |
| |
159 | 192 |
| |
160 | 193 |
| |
161 | 194 |
| |
162 |
| - | |
163 |
| - | |
164 |
| - | |
165 |
| - | |
166 |
| - | |
167 |
| - | |
168 |
| - | |
169 |
| - | |
170 |
| - | |
171 |
| - | |
172 |
| - | |
173 |
| - | |
174 |
| - | |
175 |
| - | |
176 |
| - | |
| 195 | + | |
| 196 | + | |
177 | 197 |
| |
178 | 198 |
| |
179 | 199 |
| |
| |||
189 | 209 |
| |
190 | 210 |
| |
191 | 211 |
| |
| 212 | + | |
| 213 | + | |
192 | 214 |
| |
193 | 215 |
| |
194 |
| - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
195 | 226 |
| |
| 227 | + | |
196 | 228 |
| |
197 | 229 |
|
Lines changed: 7 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
95 | 95 |
| |
96 | 96 |
| |
97 | 97 |
| |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
98 | 105 |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3180 | 3180 |
| |
3181 | 3181 |
| |
3182 | 3182 |
| |
| 3183 | + | |
3183 | 3184 |
| |
3184 | 3185 |
| |
3185 | 3186 |
| |
|
0 commit comments
Comments
(0)