From 847a23757f7cbebaa882e15087efb926113a0670 Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Mon, 25 Nov 2024 11:01:17 -0500 Subject: [PATCH] Document expected BIO operations for libssl MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If your custom BIO does not implement BIO_CTRL_FLUSH, it won't work, but this is not document anywhere. Reviewed-by: Matt Caswell Reviewed-by: Saša Nedvědický Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/26060) --- doc/man3/SSL_set_bio.pod | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/man3/SSL_set_bio.pod b/doc/man3/SSL_set_bio.pod index 5cb2a9a427..07f46ab4d7 100644 --- a/doc/man3/SSL_set_bio.pod +++ b/doc/man3/SSL_set_bio.pod @@ -23,6 +23,9 @@ function, any existing B that was previously set will also be freed via a call to L (this includes the case where the B is set to the same value as previously). +If using a custom BIO, B must implement either +L or L. + SSL_set0_wbio() works in the same as SSL_set0_rbio() except that it connects the BIO B for the write operations of the B object. Note that if the rbio and wbio are the same then SSL_set0_rbio() and SSL_set0_wbio() each take @@ -30,6 +33,12 @@ ownership of one reference. Therefore, it may be necessary to increment the number of references available using L before calling the set0 functions. +If using a custom BIO, B must implement +L or L. It additionally must +implement L using B and L. +If flushing is unnecessary with B, L should return one and +do nothing. + SSL_set_bio() is similar to SSL_set0_rbio() and SSL_set0_wbio() except that it connects both the B and the B at the same time, and transfers the ownership of B and B to B according to