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

Sergey Kandaurov pluknet at nginx.com
Tue Aug 10 21:46:33 UTC 2021


details:   https://hg.nginx.org/nginx/rev/4195a6f0c61c
branches:  
changeset: 7897:4195a6f0c61c
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 1e0fabbe01c7 -r 4195a6f0c61c 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 1e0fabbe01c7 -r 4195a6f0c61c 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