summaryrefslogtreecommitdiffstats
path: root/ssl/ssl_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-08-22 16:09:23 +0100
committerMatt Caswell <matt@openssl.org>2022-09-23 14:43:24 +0100
commitb5cf81f7c9775d2502730ba126893ce8af4db90e (patch)
treeae7582599104be7914a79883bc968c832a78a8db /ssl/ssl_lib.c
parent310590139e45116d86627dcc85e83f2e3fcbb6b4 (diff)
Replace references to s->wbio with rl->bio
We use the record layer reference to the BIO rather than the SSL object reference. This removes an unneeded SSL object usage. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19198)
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r--ssl/ssl_lib.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c
index b976324f92..f77bd7b279 100644
--- a/ssl/ssl_lib.c
+++ b/ssl/ssl_lib.c
@@ -1358,8 +1358,6 @@ void ossl_ssl_connection_free(SSL *ssl)
X509_VERIFY_PARAM_free(s->param);
dane_final(&s->dane);
- RECORD_LAYER_clear(&s->rlayer);
-
/* Ignore return value */
ssl_free_wbio_buffer(s);
@@ -1368,6 +1366,8 @@ void ossl_ssl_connection_free(SSL *ssl)
BIO_free_all(s->rbio);
s->rbio = NULL;
+ RECORD_LAYER_clear(&s->rlayer);
+
BUF_MEM_free(s->init_buf);
/* add extra stuff */
@@ -1463,6 +1463,8 @@ void SSL_set0_wbio(SSL *s, BIO *wbio)
/* Re-attach |bbio| to the new |wbio|. */
if (sc->bbio != NULL)
sc->wbio = BIO_push(sc->bbio, sc->wbio);
+
+ sc->rlayer.wrlmethod->set1_bio(sc->rlayer.wrl, sc->wbio);
}
void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio)
@@ -4809,6 +4811,8 @@ int ssl_init_wbio_buffer(SSL_CONNECTION *s)
s->bbio = bbio;
s->wbio = BIO_push(bbio, s->wbio);
+ s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);
+
return 1;
}
@@ -4819,6 +4823,8 @@ int ssl_free_wbio_buffer(SSL_CONNECTION *s)
return 1;
s->wbio = BIO_pop(s->wbio);
+ s->rlayer.wrlmethod->set1_bio(s->rlayer.wrl, s->wbio);
+
BIO_free(s->bbio);
s->bbio = NULL;