diff options
| author | cvs2svn <admin@example.com> | 2021-08-18 16:06:57 +0000 |
|---|---|---|
| committer | cvs2svn <admin@example.com> | 2021-08-18 16:06:57 +0000 |
| commit | d56c8fa8260d226f98b26f017b45b9c2b135f38d (patch) | |
| tree | 348178b41617813cc93787187984a734ef8379ca /src/lib/libcrypto/man/BIO_set_callback.3 | |
| parent | 18b9c1bcab7c37d8c5bd05b8e0d14d0c59d96650 (diff) | |
| download | openbsd-tb_20210818.tar.gz openbsd-tb_20210818.tar.bz2 openbsd-tb_20210818.zip | |
This commit was manufactured by cvs2git to create tag 'tb_20210818'.tb_20210818
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/BIO_set_callback.3 | 269 |
1 files changed, 0 insertions, 269 deletions
diff --git a/src/lib/libcrypto/man/BIO_set_callback.3 b/src/lib/libcrypto/man/BIO_set_callback.3 deleted file mode 100644 index 34b7c07a9f..0000000000 --- a/src/lib/libcrypto/man/BIO_set_callback.3 +++ /dev/null | |||
| @@ -1,269 +0,0 @@ | |||
| 1 | .\" $OpenBSD: BIO_set_callback.3,v 1.9 2018/03/29 20:42:17 schwarze Exp $ | ||
| 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
| 3 | .\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 | ||
| 4 | .\" | ||
| 5 | .\" This file is a derived work. | ||
| 6 | .\" The changes are covered by the following Copyright and license: | ||
| 7 | .\" | ||
| 8 | .\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org> | ||
| 9 | .\" | ||
| 10 | .\" Permission to use, copy, modify, and distribute this software for any | ||
| 11 | .\" purpose with or without fee is hereby granted, provided that the above | ||
| 12 | .\" copyright notice and this permission notice appear in all copies. | ||
| 13 | .\" | ||
| 14 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 15 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 16 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 17 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 18 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 19 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 20 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 21 | .\" | ||
| 22 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 23 | .\" Copyright (c) 2000, 2016, 2017 The OpenSSL Project. All rights reserved. | ||
| 24 | .\" | ||
| 25 | .\" Redistribution and use in source and binary forms, with or without | ||
| 26 | .\" modification, are permitted provided that the following conditions | ||
| 27 | .\" are met: | ||
| 28 | .\" | ||
| 29 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 30 | .\" notice, this list of conditions and the following disclaimer. | ||
| 31 | .\" | ||
| 32 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | .\" notice, this list of conditions and the following disclaimer in | ||
| 34 | .\" the documentation and/or other materials provided with the | ||
| 35 | .\" distribution. | ||
| 36 | .\" | ||
| 37 | .\" 3. All advertising materials mentioning features or use of this | ||
| 38 | .\" software must display the following acknowledgment: | ||
| 39 | .\" "This product includes software developed by the OpenSSL Project | ||
| 40 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 41 | .\" | ||
| 42 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 43 | .\" endorse or promote products derived from this software without | ||
| 44 | .\" prior written permission. For written permission, please contact | ||
| 45 | .\" openssl-core@openssl.org. | ||
| 46 | .\" | ||
| 47 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 48 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 49 | .\" permission of the OpenSSL Project. | ||
| 50 | .\" | ||
| 51 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 52 | .\" acknowledgment: | ||
| 53 | .\" "This product includes software developed by the OpenSSL Project | ||
| 54 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 55 | .\" | ||
| 56 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 57 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 58 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 59 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 60 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 61 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 62 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 63 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 64 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 65 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 68 | .\" | ||
| 69 | .Dd $Mdocdate: March 29 2018 $ | ||
| 70 | .Dt BIO_SET_CALLBACK 3 | ||
| 71 | .Os | ||
| 72 | .Sh NAME | ||
| 73 | .Nm BIO_set_callback , | ||
| 74 | .Nm BIO_get_callback , | ||
| 75 | .Nm BIO_set_callback_arg , | ||
| 76 | .Nm BIO_get_callback_arg , | ||
| 77 | .Nm BIO_debug_callback | ||
| 78 | .Nd BIO callback functions | ||
| 79 | .Sh SYNOPSIS | ||
| 80 | .In openssl/bio.h | ||
| 81 | .Ft void | ||
| 82 | .Fo BIO_set_callback | ||
| 83 | .Fa "BIO *b" | ||
| 84 | .Fa "BIO_callback_fn cb" | ||
| 85 | .Fc | ||
| 86 | .Ft BIO_callback_fn | ||
| 87 | .Fo BIO_get_callback | ||
| 88 | .Fa "BIO *b" | ||
| 89 | .Fc | ||
| 90 | .Ft void | ||
| 91 | .Fo BIO_set_callback_arg | ||
| 92 | .Fa "BIO *b" | ||
| 93 | .Fa "char *arg" | ||
| 94 | .Fc | ||
| 95 | .Ft char * | ||
| 96 | .Fo BIO_get_callback_arg | ||
| 97 | .Fa "const BIO *b" | ||
| 98 | .Fc | ||
| 99 | .Ft long | ||
| 100 | .Fo BIO_debug_callback | ||
| 101 | .Fa "BIO *bio" | ||
| 102 | .Fa "int oper" | ||
| 103 | .Fa "const char *argp" | ||
| 104 | .Fa "int argi" | ||
| 105 | .Fa "long argl" | ||
| 106 | .Fa "long ret" | ||
| 107 | .Fc | ||
| 108 | .Ft typedef long | ||
| 109 | .Fo "(*BIO_callback_fn)" | ||
| 110 | .Fa "BIO *b" | ||
| 111 | .Fa "int oper" | ||
| 112 | .Fa "const char *argp" | ||
| 113 | .Fa "int argi" | ||
| 114 | .Fa "long argl" | ||
| 115 | .Fa "long ret" | ||
| 116 | .Fc | ||
| 117 | .Sh DESCRIPTION | ||
| 118 | .Fn BIO_set_callback | ||
| 119 | and | ||
| 120 | .Fn BIO_get_callback | ||
| 121 | set and retrieve the BIO callback. | ||
| 122 | The callback is called during most high level BIO operations. | ||
| 123 | It can be used for debugging purposes to trace operations on a BIO | ||
| 124 | or to modify its operation. | ||
| 125 | .Pp | ||
| 126 | .Fn BIO_set_callback_arg | ||
| 127 | and | ||
| 128 | .Fn BIO_get_callback_arg | ||
| 129 | set and retrieve an argument for use in the callback. | ||
| 130 | .Pp | ||
| 131 | .Fn BIO_debug_callback | ||
| 132 | is a standard debugging callback which prints | ||
| 133 | out information relating to each BIO operation. | ||
| 134 | If the callback argument is set, it is interpreted as a BIO | ||
| 135 | to send the information to, otherwise stderr is used. | ||
| 136 | .Pp | ||
| 137 | .Fn BIO_callback_fn | ||
| 138 | is the type of the callback function. | ||
| 139 | The meaning of each argument is described below. | ||
| 140 | .Pp | ||
| 141 | The BIO the callback is attached to is passed in | ||
| 142 | .Fa b . | ||
| 143 | .Pp | ||
| 144 | .Fa oper | ||
| 145 | is set to the operation being performed. | ||
| 146 | For some operations the callback is called twice, | ||
| 147 | once before and once after the actual operation. | ||
| 148 | The latter case has | ||
| 149 | .Fa oper | ||
| 150 | or'ed with | ||
| 151 | .Dv BIO_CB_RETURN . | ||
| 152 | .Pp | ||
| 153 | The meaning of the arguments | ||
| 154 | .Fa argp , | ||
| 155 | .Fa argi | ||
| 156 | and | ||
| 157 | .Fa argl | ||
| 158 | depends on the value of | ||
| 159 | .Fa oper | ||
| 160 | (i.e. the operation being performed). | ||
| 161 | .Pp | ||
| 162 | When | ||
| 163 | .Fa oper | ||
| 164 | does not include | ||
| 165 | .Dv BIO_CB_RETURN , | ||
| 166 | i.e. when the callback is invoked before an operation, | ||
| 167 | the value passed into the callback via | ||
| 168 | .Fa ret | ||
| 169 | is always 1. | ||
| 170 | In this case, if the callback returns a negative value, the library | ||
| 171 | aborts the requested operation and instead returns the negative | ||
| 172 | return value from the callback to the application. | ||
| 173 | If the callback returns a non-negative value, that return value is | ||
| 174 | ignored by the library, and the operation is performed normally. | ||
| 175 | .Pp | ||
| 176 | When | ||
| 177 | .Fa oper | ||
| 178 | includes | ||
| 179 | .Dv BIO_CB_RETURN , | ||
| 180 | i.e. when the callback is invoked after an operation, | ||
| 181 | the value passed into the callback via | ||
| 182 | .Fa ret | ||
| 183 | is the return value that the operation would return to the application | ||
| 184 | if no callback were present. | ||
| 185 | When a callback is present, the operation only passes this value | ||
| 186 | to the callback and instead of it returns the return value of the | ||
| 187 | callback to the application. | ||
| 188 | .Pp | ||
| 189 | The callback should normally simply return | ||
| 190 | .Fa ret | ||
| 191 | when it has finished processing, unless it specifically wishes to | ||
| 192 | abort the operation or to modify the value returned to the application. | ||
| 193 | .Ss Callback operations | ||
| 194 | .Bl -tag -width Ds | ||
| 195 | .It Fn BIO_free b | ||
| 196 | .Fn callback b BIO_CB_FREE NULL 0L 0L 1L | ||
| 197 | is called before the free operation. | ||
| 198 | .It Fn BIO_read b out outl | ||
| 199 | .Fn callback b BIO_CB_READ out outl 0L 1L | ||
| 200 | is called before the read and | ||
| 201 | .Fn callback b BIO_CB_READ|BIO_CB_RETURN out outl 0L ret | ||
| 202 | after. | ||
| 203 | .It Fn BIO_write b in inl | ||
| 204 | .Fn callback b BIO_CB_WRITE in inl 0L 1L | ||
| 205 | is called before the write and | ||
| 206 | .Fn callback b BIO_CB_WRITE|BIO_CB_RETURN in inl 0L ret | ||
| 207 | after. | ||
| 208 | .It Fn BIO_gets b out outl | ||
| 209 | .Fn callback b BIO_CB_GETS out outl 0L 1L | ||
| 210 | is called before the operation and | ||
| 211 | .Fn callback b BIO_CB_GETS|BIO_CB_RETURN out outl 0L ret | ||
| 212 | after. | ||
| 213 | .It Fn BIO_puts b in | ||
| 214 | .Fn callback b BIO_CB_PUTS in 0 0L 1L | ||
| 215 | is called before the operation and | ||
| 216 | .Fn callback b BIO_CB_PUTS|BIO_CB_RETURN in 0 0L ret | ||
| 217 | after. | ||
| 218 | .It Fn BIO_ctrl b oper larg parg | ||
| 219 | .Fn callback b BIO_CB_CTRL parg oper larg 1L | ||
| 220 | is called before the call and | ||
| 221 | .Fn callback b BIO_CB_CTRL|BIO_CB_RETURN parg oper larg ret | ||
| 222 | after. | ||
| 223 | .El | ||
| 224 | .Sh RETURN VALUES | ||
| 225 | .Fn BIO_get_callback | ||
| 226 | returns a pointer to the function | ||
| 227 | .Fa cb | ||
| 228 | previously installed with | ||
| 229 | .Fn BIO_set_callback , | ||
| 230 | or | ||
| 231 | .Dv NULL | ||
| 232 | if no callback was installed. | ||
| 233 | .Pp | ||
| 234 | .Fn BIO_get_callback_arg | ||
| 235 | returns a pointer to the | ||
| 236 | .Fa arg | ||
| 237 | previously set with | ||
| 238 | .Fn BIO_set_callback_arg , | ||
| 239 | or | ||
| 240 | .Dv NULL | ||
| 241 | if no such argument was set. | ||
| 242 | .Pp | ||
| 243 | .Fn BIO_debug_callback | ||
| 244 | returns | ||
| 245 | .Fa ret | ||
| 246 | if the bit | ||
| 247 | .Dv BIO_CB_RETURN | ||
| 248 | is set in | ||
| 249 | .Fa cmd , | ||
| 250 | or 1 otherwise. | ||
| 251 | .Sh EXAMPLES | ||
| 252 | The | ||
| 253 | .Fn BIO_debug_callback | ||
| 254 | function is a good example. | ||
| 255 | Its source is in the file | ||
| 256 | .Pa crypto/bio/bio_cb.c . | ||
| 257 | .Sh SEE ALSO | ||
| 258 | .Xr BIO_new 3 | ||
| 259 | .Sh HISTORY | ||
| 260 | .Fn BIO_set_callback , | ||
| 261 | .Fn BIO_get_callback , | ||
| 262 | .Fn BIO_set_callback_arg , | ||
| 263 | and | ||
| 264 | .Fn BIO_debug_callback | ||
| 265 | first appeared in SSLeay 0.6.0. | ||
| 266 | .Fn BIO_get_callback_arg | ||
| 267 | first appeared in SSLeay 0.8.0. | ||
| 268 | All these functions have been available since | ||
| 269 | .Ox 2.4 . | ||
