[nginx] SSL: fixed possible segfault on renegotiation (ticket #8...

Sergey Kandaurov pluknet at nginx.com
Tue Dec 8 14:02:17 UTC 2015


details:   http://hg.nginx.org/nginx/rev/a6902a941279
branches:  
changeset: 6320:a6902a941279
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Tue Dec 08 16:59:43 2015 +0300
description:
SSL: fixed possible segfault on renegotiation (ticket #845).

Skip SSL_CTX_set_tlsext_servername_callback in case of renegotiation.
Do nothing in SNI callback as in this case it will be supplied with
request in c->data which isn't expected and doesn't work this way.

This was broken by b40af2fd1c16 (1.9.6) with OpenSSL master branch and LibreSSL.

diffstat:

 src/http/ngx_http_request.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r fe0ace132a25 -r a6902a941279 src/http/ngx_http_request.c
--- a/src/http/ngx_http_request.c	Mon Dec 07 20:09:34 2015 +0300
+++ b/src/http/ngx_http_request.c	Tue Dec 08 16:59:43 2015 +0300
@@ -837,6 +837,10 @@ ngx_http_ssl_servername(ngx_ssl_conn_t *
 
     c = ngx_ssl_get_connection(ssl_conn);
 
+    if (c->ssl->renegotiation) {
+        return SSL_TLSEXT_ERR_NOACK;
+    }
+
     ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
                    "SSL server name: \"%s\"", servername);
 



More information about the nginx-devel mailing list