diff options
Diffstat (limited to 'ssl/ssl_lib.c')
-rw-r--r-- | ssl/ssl_lib.c | 10 |
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; |