forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit31cf1a1
committed
Rework SSL renegotiation code
The existing renegotiation code was home for several bugs: it mighterroneously report that renegotiation had failed; it might try toexecute another renegotiation while the previous one was pending; itfailed to terminate the connection if the renegotiation never actuallytook place; if a renegotiation was started, the byte count was reset,even if the renegotiation wasn't completed (this isn't good from asecurity perspective because it means continuing to use a session thatshould be considered compromised due to volume of data transferred.)The new code is structured to avoid these pitfalls: renegotiation isstarted a little earlier than the limit has expired; the handshakesequence is retried until it has actually returned successfully, and nomore than that, but if it fails too many times, the connection isclosed. The byte count is reset only when the renegotiation hassucceeded, and if the renegotiation byte count limit expires, theconnection is terminated.This commit only touches the master branch, because some of the changesare controversial. If everything goes well, a back-patch might beconsidered.Per discussion started by message20130710212017.GB4941@eldon.alvh.no-ip.org1 parent956f2db commit31cf1a1
File tree
3 files changed
+70
-18
lines changed- src
- backend
- libpq
- utils/misc
- include/libpq
3 files changed
+70
-18
lines changedLines changed: 65 additions & 17 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
| 104 | + | |
| 105 | + | |
| 106 | + | |
104 | 107 |
| |
105 | 108 |
| |
106 | 109 |
| |
| |||
322 | 325 |
| |
323 | 326 |
| |
324 | 327 |
| |
325 |
| - | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
326 | 336 |
| |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
327 | 350 |
| |
328 | 351 |
| |
329 | 352 |
| |
330 | 353 |
| |
331 | 354 |
| |
332 |
| - | |
333 |
| - | |
334 |
| - | |
335 |
| - | |
336 |
| - | |
337 |
| - | |
338 |
| - | |
339 |
| - | |
340 |
| - | |
341 |
| - | |
342 |
| - | |
343 |
| - | |
344 |
| - | |
345 |
| - | |
346 |
| - | |
347 |
| - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
348 | 377 |
| |
349 | 378 |
| |
350 | 379 |
| |
| |||
390 | 419 |
| |
391 | 420 |
| |
392 | 421 |
| |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
393 | 441 |
| |
394 | 442 |
| |
395 | 443 |
| |
|
Lines changed: 0 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
126 | 126 |
| |
127 | 127 |
| |
128 | 128 |
| |
129 |
| - | |
130 | 129 |
| |
131 | 130 |
| |
132 | 131 |
| |
|
Lines changed: 5 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
95 | 100 |
| |
96 | 101 |
| |
97 | 102 |
| |
|
0 commit comments
Comments
(0)