Skip to content

Commit af6b6fb

Browse files
committed
f
Signed-off-by: Nic <[email protected]>
1 parent 0129f67 commit af6b6fb

File tree

1 file changed

+3
-30
lines changed

1 file changed

+3
-30
lines changed

patch/1.21.4/nginx-sni_restriction.patch

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,7 @@
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
262
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
295
@@ -909,6 +909,31 @@ ngx_http_ssl_servername(ngx_ssl_conn_t *ssl_conn, int *ad, void *arg)
306
goto done;
317
}
@@ -67,6 +43,3 @@ index 013b7158e..d5ac3d415 100644
6743
c->ssl->buffer_size = sscf->buffer_size;
6844

6945
if (sscf->ssl.ctx) {
70-
--
71-
2.43.0
72-

0 commit comments

Comments
 (0)