|
1 | | -From 823e886851263a8ce84fd22aeead4c3aa819bce1 Mon Sep 17 00:00:00 2001 |
2 | | -From: Sergey Kandaurov < [email protected]> |
3 | | -Date: Wed, 22 Jan 2025 18:55:44 +0400 |
4 | | -Subject: [PATCH] SNI: added restriction for TLSv1.3 cross-SNI session |
5 | | - resumption. |
6 | | - |
7 | | -In OpenSSL, session resumption always happens in the default SSL context, |
8 | | -prior to invoking the SNI callback. Further, unlike in TLSv1.2 and older |
9 | | -protocols, SSL_get_servername() returns values received in the resumption |
10 | | -handshake, which may be different from the value in the initial handshake. |
11 | | -Notably, this makes the restriction added in b720f650b insufficient for |
12 | | -sessions resumed with different SNI server name. |
13 | | - |
14 | | -Considering the example from b720f650b, previously, a client was able to |
15 | | -request example.org by presenting a certificate for example.org, then to |
16 | | -resume and request example.com. |
17 | | - |
18 | | -The fix is to reject handshakes resumed with a different server name, if |
19 | | -verification of client certificates is enabled in a corresponding server |
20 | | -configuration. |
21 | | ---- |
22 | | - src/http/ngx_http_request.c | 27 +++++++++++++++++++++++++-- |
23 | | - 1 file changed, 25 insertions(+), 2 deletions(-) |
24 | | - |
25 | | -diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c |
| 1 | +diff --git src/http/ngx_http_request.c src/http/ngx_http_request.c |
26 | 2 | index 013b7158e..d5ac3d415 100644 |
27 | | ---- a/src/http/ngx_http_request.c |
28 | | -+++ b/src/http/ngx_http_request.c |
| 3 | +--- src/http/ngx_http_request.c |
| 4 | ++++ src/http/ngx_http_request.c |
29 | 5 | @@ -909,6 +909,31 @@ ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg) |
30 | 6 | goto done; |
31 | 7 | } |
@@ -67,6 +43,3 @@ index 013b7158e..d5ac3d415 100644 |
67 | 43 | c->ssl->buffer_size = sscf->buffer_size; |
68 | 44 |
|
69 | 45 | if (sscf->ssl.ctx) { |
70 | | --- |
71 | | -2.43.0 |
72 | | - |
0 commit comments