[nginx] SSL: ERR_peek_error_line_data() compatibility with OpenSSL 3.0.

Maxim Dounin mdounin at mdounin.ru
Tue Nov 16 14:51:08 UTC 2021


details:   https://hg.nginx.org/nginx/rev/9b9299494238
branches:  stable-1.20
changeset: 7963:9b9299494238
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Tue Aug 10 23:43:16 2021 +0300
description:
SSL: ERR_peek_error_line_data() compatibility with OpenSSL 3.0.

ERR_peek_error_line_data() was deprecated in favour of ERR_peek_error_all().
Here we use the ERR_peek_error_data() helper to pass only used arguments.

diffstat:

 src/event/ngx_event_openssl.c |  2 +-
 src/event/ngx_event_openssl.h |  5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diffs (27 lines):

diff -r ddfad46492b5 -r 9b9299494238 src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c	Tue Aug 10 23:43:16 2021 +0300
+++ b/src/event/ngx_event_openssl.c	Tue Aug 10 23:43:16 2021 +0300
@@ -3280,7 +3280,7 @@ ngx_ssl_error(ngx_uint_t level, ngx_log_
 
         for ( ;; ) {
 
-            n = ERR_peek_error_line_data(NULL, NULL, &data, &flags);
+            n = ERR_peek_error_data(&data, &flags);
 
             if (n == 0) {
                 break;
diff -r ddfad46492b5 -r 9b9299494238 src/event/ngx_event_openssl.h
--- a/src/event/ngx_event_openssl.h	Tue Aug 10 23:43:16 2021 +0300
+++ b/src/event/ngx_event_openssl.h	Tue Aug 10 23:43:16 2021 +0300
@@ -69,6 +69,11 @@
 #endif
 
 
+#if (OPENSSL_VERSION_NUMBER < 0x30000000L && !defined ERR_peek_error_data)
+#define ERR_peek_error_data(d, f)    ERR_peek_error_line_data(NULL, NULL, d, f)
+#endif
+
+
 typedef struct ngx_ssl_ocsp_s  ngx_ssl_ocsp_t;
 
 


More information about the nginx-devel mailing list