Commit f3049a6
committed
Refactor channel binding code to fetch cbind_data only when necessary
As things stand now, channel binding data is fetched from OpenSSL and
saved into the SCRAM exchange context for any SSL connection attempted
for a SCRAM authentication, resulting in data fetched but not used if no
channel binding is used or if a different channel binding type is used
than what the data is here for.
Refactor the code in such a way that binding data is fetched from the
SSL stack only when a specific channel binding is used for both the
frontend and the backend. In order to achieve that, save the libpq
connection context directly in the SCRAM exchange state, and add a
dependency to SSL in the low-level SCRAM routines.
This makes the interface in charge of initializing the SCRAM context
cleaner as all its data comes from either PGconn* (for frontend) or
Port* (for the backend).
Author: Michael Paquier <michael.paquier@gmail.com>1 parent 3ad2afc commit f3049a6
File tree
6 files changed
+102
-152
lines changed- src
- backend/libpq
- include/libpq
- interfaces/libpq
6 files changed
+102
-152
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
| 113 | + | |
113 | 114 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | 115 | | |
118 | 116 | | |
119 | 117 | | |
| |||
172 | 170 | | |
173 | 171 | | |
174 | 172 | | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
| 173 | + | |
| 174 | + | |
180 | 175 | | |
181 | 176 | | |
182 | 177 | | |
183 | 178 | | |
184 | 179 | | |
| 180 | + | |
185 | 181 | | |
186 | | - | |
187 | | - | |
188 | | - | |
189 | | - | |
190 | 182 | | |
191 | 183 | | |
192 | 184 | | |
| |||
209 | 201 | | |
210 | 202 | | |
211 | 203 | | |
212 | | - | |
| 204 | + | |
213 | 205 | | |
214 | 206 | | |
215 | 207 | | |
| |||
220 | 212 | | |
221 | 213 | | |
222 | 214 | | |
223 | | - | |
| 215 | + | |
224 | 216 | | |
225 | 217 | | |
226 | 218 | | |
| |||
242 | 234 | | |
243 | 235 | | |
244 | 236 | | |
245 | | - | |
246 | | - | |
| 237 | + | |
| 238 | + | |
247 | 239 | | |
248 | 240 | | |
249 | 241 | | |
| |||
815 | 807 | | |
816 | 808 | | |
817 | 809 | | |
818 | | - | |
| 810 | + | |
819 | 811 | | |
820 | 812 | | |
821 | 813 | | |
| |||
839 | 831 | | |
840 | 832 | | |
841 | 833 | | |
842 | | - | |
| 834 | + | |
843 | 835 | | |
844 | 836 | | |
845 | 837 | | |
| |||
1120 | 1112 | | |
1121 | 1113 | | |
1122 | 1114 | | |
1123 | | - | |
1124 | | - | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
1125 | 1118 | | |
1126 | 1119 | | |
1127 | 1120 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
873 | 873 | | |
874 | 874 | | |
875 | 875 | | |
876 | | - | |
877 | | - | |
878 | 876 | | |
879 | 877 | | |
880 | 878 | | |
| |||
915 | 913 | | |
916 | 914 | | |
917 | 915 | | |
918 | | - | |
919 | | - | |
920 | | - | |
921 | | - | |
922 | | - | |
923 | | - | |
924 | | - | |
925 | | - | |
926 | | - | |
927 | | - | |
928 | | - | |
929 | 916 | | |
930 | 917 | | |
931 | 918 | | |
| |||
937 | 924 | | |
938 | 925 | | |
939 | 926 | | |
940 | | - | |
941 | | - | |
942 | | - | |
943 | | - | |
944 | | - | |
| 927 | + | |
945 | 928 | | |
946 | 929 | | |
947 | 930 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
23 | | - | |
24 | | - | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
0 commit comments