From: Joe Orton <jorton@redhat.com>
Date: Mon, 26 Jul 2021 14:15:28 +0100
Subject: Support for OpenSSL 1.1.0: - BIO was made opaque after OpenSSL
 1.1.0pre4.

Submitted by: rjung


Forwarded: yes, https://github.com/apache/httpd/pull/258
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1951476
---
 modules/ssl/ssl_engine_io.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/ssl/ssl_engine_io.c b/modules/ssl/ssl_engine_io.c
index f7e5cfc..3db7077 100644
--- a/modules/ssl/ssl_engine_io.c
+++ b/modules/ssl/ssl_engine_io.c
@@ -194,7 +194,7 @@ static int bio_filter_destroy(BIO *bio)
 static int bio_filter_out_read(BIO *bio, char *out, int outl)
 {
     /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)(bio->ptr);
+    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
                   "BUG: %s() should not be called", "bio_filter_out_read");
     AP_DEBUG_ASSERT(0);
@@ -297,7 +297,7 @@ static long bio_filter_out_ctrl(BIO *bio, int cmd, long num, void *ptr)
 static int bio_filter_out_gets(BIO *bio, char *buf, int size)
 {
     /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)(bio->ptr);
+    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
                   "BUG: %s() should not be called", "bio_filter_out_gets");
     AP_DEBUG_ASSERT(0);
@@ -307,7 +307,7 @@ static int bio_filter_out_gets(BIO *bio, char *buf, int size)
 static int bio_filter_out_puts(BIO *bio, const char *str)
 {
     /* this is never called */
-    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)(bio->ptr);
+    bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, outctx->c,
                   "BUG: %s() should not be called", "bio_filter_out_puts");
     AP_DEBUG_ASSERT(0);
@@ -545,7 +545,7 @@ static int bio_filter_in_read(BIO *bio, char *in, int inlen)
 
 static int bio_filter_in_write(BIO *bio, const char *in, int inl)
 {
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)(bio->ptr);
+    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
                   "BUG: %s() should not be called", "bio_filter_in_write");
     AP_DEBUG_ASSERT(0);
@@ -554,7 +554,7 @@ static int bio_filter_in_write(BIO *bio, const char *in, int inl)
 
 static int bio_filter_in_puts(BIO *bio, const char *str)
 {
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)(bio->ptr);
+    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
                   "BUG: %s() should not be called", "bio_filter_in_puts");
     AP_DEBUG_ASSERT(0);
@@ -563,7 +563,7 @@ static int bio_filter_in_puts(BIO *bio, const char *str)
 
 static int bio_filter_in_gets(BIO *bio, char *buf, int size)
 {
-    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)(bio->ptr);
+    bio_filter_in_ctx_t *inctx = (bio_filter_in_ctx_t *)BIO_get_data(bio);
     ap_log_cerror(APLOG_MARK, APLOG_TRACE1, 0, inctx->f->c,
                   "BUG: %s() should not be called", "bio_filter_in_gets");
     AP_DEBUG_ASSERT(0);
