From edf2683169fb4c4c5a3fb563579a59ee2b0bf941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Thu, 15 Dec 2022 12:09:27 +0100 Subject: [PATCH] SSL_CTX_set_cert_cb() callback yielding patch update --- debian/patches/nginx-ssl_cert_cb_yield.patch | 35 +++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/debian/patches/nginx-ssl_cert_cb_yield.patch b/debian/patches/nginx-ssl_cert_cb_yield.patch index df21b02..adb1ba5 100644 --- a/debian/patches/nginx-ssl_cert_cb_yield.patch +++ b/debian/patches/nginx-ssl_cert_cb_yield.patch @@ -1,8 +1,11 @@ -Description: SSL: handled SSL_CTX_set_cert_cb() callback yielding. -Author: Yichun Zhang -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=884434 -Origin: https://raw.githubusercontent.com/openresty/openresty/v1.11.2.2/patches/nginx-1.11.2-ssl_cert_cb_yield.patch -Last-Update: 2016-01-02 +Origin: https://github.com/openresty/openresty/blob/master/patches/nginx-1.21.4-ssl_cert_cb_yield.patch +# HG changeset patch +# User Yichun Zhang +# Date 1451762084 28800 +# Sat Jan 02 11:14:44 2016 -0800 +# Node ID 449f0461859c16e95bdb18e8be6b94401545d3dd +# Parent 78b4e10b4367b31367aad3c83c9c3acdd42397c4 +SSL: handled SSL_CTX_set_cert_cb() callback yielding. OpenSSL 1.0.2+ introduces SSL_CTX_set_cert_cb() to allow custom callbacks to serve the SSL certificiates and private keys dynamically @@ -37,3 +40,25 @@ connections. err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0; c->ssl->no_wait_shutdown = 1; +@@ -1968,6 +1985,21 @@ + c->read->handler = ngx_ssl_handshake_handler; + c->write->handler = ngx_ssl_handshake_handler; + ++ if (ngx_handle_read_event(c->read, 0) != NGX_OK) { ++ return NGX_ERROR; ++ } ++ ++ if (ngx_handle_write_event(c->write, 0) != NGX_OK) { ++ return NGX_ERROR; ++ } ++ ++ return NGX_AGAIN; ++ } ++ ++ if (sslerr == SSL_ERROR_WANT_X509_LOOKUP) { ++ c->read->handler = ngx_ssl_handshake_handler; ++ c->write->handler = ngx_ssl_handshake_handler; ++ + if (ngx_handle_read_event(c->read, 0) != NGX_OK) { + return NGX_ERROR; + }