Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7777df3

Browse filesBrowse files
committed
Disallow SSL renegotiation
SSL renegotiation is already disabled as of 48d23c7, however this does not prevent the server to comply with a client willing to use renegotiation. In the last couple of years, renegotiation had its set of security issues and flaws (like the recent CVE-2021-3449), and it could be possible to crash the backend with a client attempting renegotiation. This commit takes one extra step by disabling renegotiation in the backend in the same way as SSL compression (f9264d1) or tickets (97d3a0b). OpenSSL 1.1.0h has added an option named SSL_OP_NO_RENEGOTIATION able to achieve that. In older versions there is an option called SSL3_FLAGS_NO_RENEGOTIATE_CIPHERS that was undocumented, and could be set within the SSL object created when the TLS connection opens, but I have decided not to use it, as it feels trickier to rely on, and it is not official. Note that this option is not usable in OpenSSL < 1.1.0h as the internal contents of the *SSL object are hidden to applications. SSL renegotiation concerns protocols up to TLSv1.2. Per original report from Robert Haas, with a patch based on a suggestion by Andres Freund. Author: Michael Paquier Reviewed-by: Daniel Gustafsson Discussion: https://postgr.es/m/YKZBXx7RhU74FlTE@paquier.xyz Backpatch-through: 9.6
1 parent 85c8094 commit 7777df3
Copy full SHA for 7777df3

File tree

Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-0
lines changed

‎src/backend/libpq/be-secure-openssl.c

Copy file name to clipboardExpand all lines: src/backend/libpq/be-secure-openssl.c
+10Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ be_tls_init(void)
278278
/* disallow SSL session caching, too */
279279
SSL_CTX_set_session_cache_mode(SSL_context, SSL_SESS_CACHE_OFF);
280280

281+
#ifdef SSL_OP_NO_RENEGOTIATION
282+
283+
/*
284+
* Disallow SSL renegotiation, option available since 1.1.0h. This
285+
* concerns only TLSv1.2 and older protocol versions, as TLSv1.3 has no
286+
* support for renegotiation.
287+
*/
288+
SSL_CTX_set_options(SSL_context, SSL_OP_NO_RENEGOTIATION);
289+
#endif
290+
281291
/* set up ephemeral ECDH keys */
282292
initialize_ecdh();
283293

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.