summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/BIO_ctrl.3104
1 files changed, 96 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/BIO_ctrl.3 b/src/lib/libcrypto/man/BIO_ctrl.3
index a5c181307e..0c2ad2b737 100644
--- a/src/lib/libcrypto/man/BIO_ctrl.3
+++ b/src/lib/libcrypto/man/BIO_ctrl.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: BIO_ctrl.3,v 1.17 2023/04/04 17:10:37 schwarze Exp $ 1.\" $OpenBSD: BIO_ctrl.3,v 1.18 2023/04/06 19:06:51 schwarze Exp $
2.\" full merge up to: OpenSSL 24a535eaf Tue Sep 22 13:14:20 2020 +0100 2.\" full merge up to: OpenSSL 24a535eaf Tue Sep 22 13:14:20 2020 +0100
3.\" selective merge up to: OpenSSL 0c5bc96f Tue Mar 15 13:57:22 2022 +0000 3.\" selective merge up to: OpenSSL 0c5bc96f Tue Mar 15 13:57:22 2022 +0000
4.\" 4.\"
@@ -66,7 +66,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: April 4 2023 $ 69.Dd $Mdocdate: April 6 2023 $
70.Dt BIO_CTRL 3 70.Dt BIO_CTRL 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -87,7 +87,8 @@
87.Nm BIO_ctrl_wpending , 87.Nm BIO_ctrl_wpending ,
88.Nm BIO_get_info_callback , 88.Nm BIO_get_info_callback ,
89.Nm BIO_set_info_callback , 89.Nm BIO_set_info_callback ,
90.Nm BIO_info_cb 90.Nm BIO_info_cb ,
91.Nm bio_info_cb
91.Nd BIO control operations 92.Nd BIO control operations
92.Sh SYNOPSIS 93.Sh SYNOPSIS
93.In openssl/bio.h 94.In openssl/bio.h
@@ -179,6 +180,12 @@
179.Fa "int state" 180.Fa "int state"
180.Fa "int res" 181.Fa "int res"
181.Fc 182.Fc
183.Ft typedef int
184.Fo bio_info_cb
185.Fa "BIO *b"
186.Fa "int state"
187.Fa "int res"
188.Fc
182.Sh DESCRIPTION 189.Sh DESCRIPTION
183.Fn BIO_ctrl , 190.Fn BIO_ctrl ,
184.Fn BIO_callback_ctrl , 191.Fn BIO_callback_ctrl ,
@@ -217,6 +224,12 @@ function pointer, which is built into the library for some standard BIO
217types and can be provided with 224types and can be provided with
218.Xr BIO_meth_set_callback_ctrl 3 225.Xr BIO_meth_set_callback_ctrl 3
219for application-defined BIO types. 226for application-defined BIO types.
227The only
228.Fa cmd
229supported by
230.Fn BIO_callback_ctrl
231is
232.Dv BIO_CTRL_SET_CALLBACK .
220.Pp 233.Pp
221.Fn BIO_ptr_ctrl 234.Fn BIO_ptr_ctrl
222calls 235calls
@@ -299,6 +312,43 @@ and
299.Fn BIO_wpending 312.Fn BIO_wpending
300are macros which call 313are macros which call
301.Fn BIO_ctrl . 314.Fn BIO_ctrl .
315.Pp
316.Fn BIO_set_info_callback
317installs the function pointer
318.Fa cb
319as an info callback in
320.Fa b
321by calling
322.Fn BIO_callback_ctrl
323with a command of
324.Dv BIO_CTRL_SET_CALLBACK .
325Among the BIO types built into the library, only
326.Xr BIO_s_connect 3
327and
328.Xr BIO_f_ssl 3
329support this functionality.
330Some filter BIO types forward this control call
331to the next BIO in the chain instead of processing it themselves.
332.Pp
333.Fn BIO_get_info_callback
334places the function pointer to the info callback into
335.Pf * Fa cbp
336if any was installed using
337.Fn BIO_set_info_callback
338or
339.Fn BIO_callback_ctrl .
340If the type of
341.Fa b
342supports setting an info callback but none was installed, it stores a
343.Dv NULL
344pointer in
345.Pf * Fa cbp .
346.Pp
347The function type name
348.Vt bio_info_cb
349is a deprecated synonym for
350.Vt BIO_info_cb
351provided for backward compatibility with some existing application software.
302.Sh RETURN VALUES 352.Sh RETURN VALUES
303The meaning of the return values of 353The meaning of the return values of
304.Fn BIO_ctrl , 354.Fn BIO_ctrl ,
@@ -319,11 +369,20 @@ In particular, it is returned if the
319.Fa cmd 369.Fa cmd
320is unsupported by the type of 370is unsupported by the type of
321.Fa b . 371.Fa b .
322If a callback was installed with 372.Pp
323.Xr BIO_set_callback_ex 3 373.Fn BIO_callback_ctrl
324or 374and
325.Xr BIO_set_callback 3 375.Fn BIO_set_info_callback
326and returns a negative value, that value is returned. 376return 1 on success, 0 if
377.Fa b
378is
379.Dv NULL
380or to indicate failure of a valid
381.Fa cmd ,
382or \-2 if the
383.Fa cmd
384is not supported by
385.Fa b .
327.Pp 386.Pp
328.Fn BIO_ptr_ctrl 387.Fn BIO_ptr_ctrl
329returns 388returns
@@ -373,6 +432,26 @@ or
373and 432and
374.Fn BIO_ctrl_wpending 433.Fn BIO_ctrl_wpending
375return the amount of pending data. 434return the amount of pending data.
435.Pp
436.Fn BIO_get_info_callback
437returns 1 on success, including when the type of
438.Fa b
439supports an info callback but none is installed,
4400 if
441.Fa b
442is
443.Dv NULL
444or \-2 if the type of
445.Fa b
446does not support an info callback.
447.Pp
448If a callback was installed in
449.Fa b
450using
451.Xr BIO_set_callback_ex 3
452or
453.Xr BIO_set_callback 3 ,
454it can modify the return values of all these functions.
376.Sh NOTES 455.Sh NOTES
377Because it can write data, 456Because it can write data,
378.Fn BIO_flush 457.Fn BIO_flush
@@ -448,6 +527,15 @@ These functions have been available since
448.Fn BIO_callback_ctrl 527.Fn BIO_callback_ctrl
449first appeared in OpenSSL 0.9.5 and has been available since 528first appeared in OpenSSL 0.9.5 and has been available since
450.Ox 2.7 . 529.Ox 2.7 .
530.Pp
531.Fn bio_info_cb
532first appeared with a more complicated prototype in OpenSSL 0.9.6
533and has been available since
534.Ox 2.9 .
535.Pp
536.Fn BIO_info_cb
537first appeared in OpenSSL 1.1.0h and has been available since
538.Ox 6.3 .
451.Sh BUGS 539.Sh BUGS
452Some of the return values are ambiguous and care should be taken. 540Some of the return values are ambiguous and care should be taken.
453In particular a return value of 0 can be returned if an operation 541In particular a return value of 0 can be returned if an operation