diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/BIO_meth_new.3 | 100 |
1 files changed, 89 insertions, 11 deletions
diff --git a/src/lib/libcrypto/man/BIO_meth_new.3 b/src/lib/libcrypto/man/BIO_meth_new.3 index 0036bd1b2b..813b6bce4b 100644 --- a/src/lib/libcrypto/man/BIO_meth_new.3 +++ b/src/lib/libcrypto/man/BIO_meth_new.3 | |||
| @@ -1,4 +1,5 @@ | |||
| 1 | .\" $OpenBSD: BIO_meth_new.3,v 1.2 2018/02/19 14:22:15 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_meth_new.3,v 1.3 2018/02/23 19:12:09 schwarze Exp $ |
| 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | ||
| 2 | .\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 | 3 | .\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 |
| 3 | .\" | 4 | .\" |
| 4 | .\" This file is a derived work. | 5 | .\" This file is a derived work. |
| @@ -65,22 +66,34 @@ | |||
| 65 | .\" 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 |
| 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 67 | .\" | 68 | .\" |
| 68 | .Dd $Mdocdate: February 19 2018 $ | 69 | .Dd $Mdocdate: February 23 2018 $ |
| 69 | .Dt BIO_METH_NEW 3 | 70 | .Dt BIO_METH_NEW 3 |
| 70 | .Os | 71 | .Os |
| 71 | .Sh NAME | 72 | .Sh NAME |
| 73 | .Nm BIO_get_new_index , | ||
| 72 | .Nm BIO_meth_new , | 74 | .Nm BIO_meth_new , |
| 73 | .Nm BIO_meth_free , | 75 | .Nm BIO_meth_free , |
| 76 | .Nm BIO_meth_get_write , | ||
| 74 | .Nm BIO_meth_set_write , | 77 | .Nm BIO_meth_set_write , |
| 78 | .Nm BIO_meth_get_read , | ||
| 75 | .Nm BIO_meth_set_read , | 79 | .Nm BIO_meth_set_read , |
| 80 | .Nm BIO_meth_get_puts , | ||
| 76 | .Nm BIO_meth_set_puts , | 81 | .Nm BIO_meth_set_puts , |
| 82 | .Nm BIO_meth_get_gets , | ||
| 77 | .Nm BIO_meth_set_gets , | 83 | .Nm BIO_meth_set_gets , |
| 84 | .Nm BIO_meth_get_ctrl , | ||
| 78 | .Nm BIO_meth_set_ctrl , | 85 | .Nm BIO_meth_set_ctrl , |
| 86 | .Nm BIO_meth_get_create , | ||
| 79 | .Nm BIO_meth_set_create , | 87 | .Nm BIO_meth_set_create , |
| 80 | .Nm BIO_meth_set_destroy | 88 | .Nm BIO_meth_get_destroy , |
| 89 | .Nm BIO_meth_set_destroy , | ||
| 90 | .Nm BIO_meth_get_callback_ctrl , | ||
| 91 | .Nm BIO_meth_set_callback_ctrl | ||
| 81 | .Nd manipulate BIO_METHOD structures | 92 | .Nd manipulate BIO_METHOD structures |
| 82 | .Sh SYNOPSIS | 93 | .Sh SYNOPSIS |
| 83 | .In openssl/bio.h | 94 | .In openssl/bio.h |
| 95 | .Ft int | ||
| 96 | .Fn BIO_get_new_index void | ||
| 84 | .Ft BIO_METHOD * | 97 | .Ft BIO_METHOD * |
| 85 | .Fo BIO_meth_new | 98 | .Fo BIO_meth_new |
| 86 | .Fa "int type" | 99 | .Fa "int type" |
| @@ -91,40 +104,65 @@ | |||
| 91 | .Fa "BIO_METHOD *biom" | 104 | .Fa "BIO_METHOD *biom" |
| 92 | .Fc | 105 | .Fc |
| 93 | .Ft int | 106 | .Ft int |
| 107 | .Fn "(*BIO_meth_get_write(BIO_METHOD *biom))" "BIO *" "const char *" int | ||
| 108 | .Ft int | ||
| 94 | .Fo BIO_meth_set_write | 109 | .Fo BIO_meth_set_write |
| 95 | .Fa "BIO_METHOD *biom" | 110 | .Fa "BIO_METHOD *biom" |
| 96 | .Fa "int (*write)(BIO *, const char *, int)" | 111 | .Fa "int (*write)(BIO *, const char *, int)" |
| 97 | .Fc | 112 | .Fc |
| 98 | .Ft int | 113 | .Ft int |
| 114 | .Fn "(*BIO_meth_get_read(BIO_METHOD *biom))" "BIO *" "char *" int | ||
| 115 | .Ft int | ||
| 99 | .Fo BIO_meth_set_read | 116 | .Fo BIO_meth_set_read |
| 100 | .Fa "BIO_METHOD *biom" | 117 | .Fa "BIO_METHOD *biom" |
| 101 | .Fa "int (*read)(BIO *, char *, int)" | 118 | .Fa "int (*read)(BIO *, char *, int)" |
| 102 | .Fc | 119 | .Fc |
| 103 | .Ft int | 120 | .Ft int |
| 121 | .Fn "(*BIO_meth_get_puts(BIO_METHOD *biom))" "BIO *" "const char *" | ||
| 122 | .Ft int | ||
| 104 | .Fo BIO_meth_set_puts | 123 | .Fo BIO_meth_set_puts |
| 105 | .Fa "BIO_METHOD *biom" | 124 | .Fa "BIO_METHOD *biom" |
| 106 | .Fa "int (*puts)(BIO *, const char *)" | 125 | .Fa "int (*puts)(BIO *, const char *)" |
| 107 | .Fc | 126 | .Fc |
| 108 | .Ft int | 127 | .Ft int |
| 128 | .Fn "(*BIO_meth_get_gets(BIO_METHOD *biom))" "BIO *" "char *" int | ||
| 129 | .Ft int | ||
| 109 | .Fo BIO_meth_set_gets | 130 | .Fo BIO_meth_set_gets |
| 110 | .Fa "BIO_METHOD *biom" | 131 | .Fa "BIO_METHOD *biom" |
| 111 | .Fa "int (*gets)(BIO *, char *, int)" | 132 | .Fa "int (*gets)(BIO *, char *, int)" |
| 112 | .Fc | 133 | .Fc |
| 134 | .Ft long | ||
| 135 | .Fn "(*BIO_meth_get_ctrl(BIO_METHOD *biom))" "BIO *" int long "void *" | ||
| 113 | .Ft int | 136 | .Ft int |
| 114 | .Fo BIO_meth_set_ctrl | 137 | .Fo BIO_meth_set_ctrl |
| 115 | .Fa "BIO_METHOD *biom" | 138 | .Fa "BIO_METHOD *biom" |
| 116 | .Fa "long (*ctrl)(BIO *, int, long, void *)" | 139 | .Fa "long (*ctrl)(BIO *, int, long, void *)" |
| 117 | .Fc | 140 | .Fc |
| 118 | .Ft int | 141 | .Ft int |
| 142 | .Fn "(*BIO_meth_get_create(BIO_METHOD *biom))" "BIO *" | ||
| 143 | .Ft int | ||
| 119 | .Fo BIO_meth_set_create | 144 | .Fo BIO_meth_set_create |
| 120 | .Fa "BIO_METHOD *biom" | 145 | .Fa "BIO_METHOD *biom" |
| 121 | .Fa "int (*create)(BIO *)" | 146 | .Fa "int (*create)(BIO *)" |
| 122 | .Fc | 147 | .Fc |
| 123 | .Ft int | 148 | .Ft int |
| 149 | .Fn "(*BIO_meth_get_destroy(BIO_METHOD *biom))" "BIO *" | ||
| 150 | .Ft int | ||
| 124 | .Fo BIO_meth_set_destroy | 151 | .Fo BIO_meth_set_destroy |
| 125 | .Fa "BIO_METHOD *biom" | 152 | .Fa "BIO_METHOD *biom" |
| 126 | .Fa "int (*destroy)(BIO *)" | 153 | .Fa "int (*destroy)(BIO *)" |
| 127 | .Fc | 154 | .Fc |
| 155 | .Ft long | ||
| 156 | .Fo "(*BIO_meth_get_callback_ctrl(BIO_METHOD *biom))" | ||
| 157 | .Fa "BIO *" | ||
| 158 | .Fa int | ||
| 159 | .Fa "BIO_info_cb *" | ||
| 160 | .Fc | ||
| 161 | .Ft int | ||
| 162 | .Fo BIO_meth_set_callback_ctrl | ||
| 163 | .Fa "BIO_METHOD *biom" | ||
| 164 | .Fa "long (*callback_ctrl)(BIO *, int, BIO_info_cb *)" | ||
| 165 | .Fc | ||
| 128 | .Sh DESCRIPTION | 166 | .Sh DESCRIPTION |
| 129 | The | 167 | The |
| 130 | .Vt BIO_METHOD | 168 | .Vt BIO_METHOD |
| @@ -142,7 +180,14 @@ creates a new | |||
| 142 | .Vt BIO_METHOD | 180 | .Vt BIO_METHOD |
| 143 | structure. | 181 | structure. |
| 144 | It requires a unique integer | 182 | It requires a unique integer |
| 183 | .Fa type ; | ||
| 184 | use | ||
| 185 | .Fn BIO_get_new_index | ||
| 186 | to get the value for | ||
| 145 | .Fa type . | 187 | .Fa type . |
| 188 | Currently, the user can only create up to 127 different BIO types, and | ||
| 189 | .Fa type | ||
| 190 | is limited to the range 129\(en255. | ||
| 146 | The | 191 | The |
| 147 | .Fa name | 192 | .Fa name |
| 148 | pointer is stored in the structure and will not be freed by | 193 | pointer is stored in the structure and will not be freed by |
| @@ -174,10 +219,12 @@ for more information. | |||
| 174 | is an alias for | 219 | is an alias for |
| 175 | .Xr free 3 . | 220 | .Xr free 3 . |
| 176 | .Pp | 221 | .Pp |
| 177 | .Fn BIO_meth_set_write | 222 | .Fn BIO_meth_get_write , |
| 223 | .Fn BIO_meth_set_write , | ||
| 224 | .Fn BIO_meth_get_read , | ||
| 178 | and | 225 | and |
| 179 | .Fn BIO_meth_set_read | 226 | .Fn BIO_meth_set_read |
| 180 | set the functions | 227 | get and set the functions |
| 181 | .Fa write | 228 | .Fa write |
| 182 | and | 229 | and |
| 183 | .Fa read | 230 | .Fa read |
| @@ -197,8 +244,10 @@ have the same meaning as for | |||
| 197 | and | 244 | and |
| 198 | .Xr BIO_read 3 . | 245 | .Xr BIO_read 3 . |
| 199 | .Pp | 246 | .Pp |
| 247 | .Fn BIO_meth_get_puts | ||
| 248 | and | ||
| 200 | .Fn BIO_meth_set_puts | 249 | .Fn BIO_meth_set_puts |
| 201 | sets the function | 250 | get and set the function |
| 202 | .Fa puts | 251 | .Fa puts |
| 203 | used for writing a NUL-terminated string to the | 252 | used for writing a NUL-terminated string to the |
| 204 | .Vt BIO . | 253 | .Vt BIO . |
| @@ -209,10 +258,12 @@ The parameters and the return value of | |||
| 209 | have the same meaning as for | 258 | have the same meaning as for |
| 210 | .Xr BIO_puts 3 . | 259 | .Xr BIO_puts 3 . |
| 211 | .Pp | 260 | .Pp |
| 261 | .Fn BIO_meth_get_gets | ||
| 262 | and | ||
| 212 | .Fn BIO_meth_set_gets | 263 | .Fn BIO_meth_set_gets |
| 213 | sets the function | 264 | get and set the function |
| 214 | .Fa gets | 265 | .Fa gets |
| 215 | used for reading a line of data to the | 266 | used for reading a line of data from the |
| 216 | .Vt BIO . | 267 | .Vt BIO . |
| 217 | This function is called from | 268 | This function is called from |
| 218 | .Xr BIO_gets 3 . | 269 | .Xr BIO_gets 3 . |
| @@ -221,8 +272,10 @@ The parameters and the return value of | |||
| 221 | have the same meaning as for | 272 | have the same meaning as for |
| 222 | .Xr BIO_gets 3 . | 273 | .Xr BIO_gets 3 . |
| 223 | .Pp | 274 | .Pp |
| 275 | .Fn BIO_meth_get_ctrl | ||
| 276 | and | ||
| 224 | .Fn BIO_meth_set_ctrl | 277 | .Fn BIO_meth_set_ctrl |
| 225 | sets the function | 278 | get and set the function |
| 226 | .Fa ctrl | 279 | .Fa ctrl |
| 227 | used for processing control messages in the | 280 | used for processing control messages in the |
| 228 | .Vt BIO . | 281 | .Vt BIO . |
| @@ -233,8 +286,10 @@ The parameters and return value of | |||
| 233 | have the same meaning as for | 286 | have the same meaning as for |
| 234 | .Xr BIO_ctrl 3 . | 287 | .Xr BIO_ctrl 3 . |
| 235 | .Pp | 288 | .Pp |
| 289 | .Fn BIO_meth_get_create | ||
| 290 | and | ||
| 236 | .Fn BIO_meth_set_create | 291 | .Fn BIO_meth_set_create |
| 237 | sets a function | 292 | get and set a function |
| 238 | .Fa create | 293 | .Fa create |
| 239 | used while initializing a new instance of the | 294 | used while initializing a new instance of the |
| 240 | .Vt BIO . | 295 | .Vt BIO . |
| @@ -248,8 +303,10 @@ and a pointer to this newly allocated structure is passed | |||
| 248 | as the parameter to | 303 | as the parameter to |
| 249 | .Fa create . | 304 | .Fa create . |
| 250 | .Pp | 305 | .Pp |
| 306 | .Fn BIO_meth_get_destroy | ||
| 307 | and | ||
| 251 | .Fn BIO_meth_set_destroy | 308 | .Fn BIO_meth_set_destroy |
| 252 | sets a function | 309 | get and set a function |
| 253 | .Fa destroy | 310 | .Fa destroy |
| 254 | used while destroying an instance of a | 311 | used while destroying an instance of a |
| 255 | .Vt BIO . | 312 | .Vt BIO . |
| @@ -266,7 +323,24 @@ function is intended to perform clean-up specific to the | |||
| 266 | The memory for the | 323 | The memory for the |
| 267 | .Vt BIO | 324 | .Vt BIO |
| 268 | itself must not be freed by this function. | 325 | itself must not be freed by this function. |
| 326 | .Pp | ||
| 327 | .Fn BIO_meth_get_callback_ctrl | ||
| 328 | and | ||
| 329 | .Fn BIO_meth_set_callback_ctrl | ||
| 330 | get and set the function | ||
| 331 | .Fa callback_ctrl | ||
| 332 | used for processing callback control messages in the | ||
| 333 | .Vt BIO . | ||
| 334 | This function is called from | ||
| 335 | .Xr BIO_callback_ctrl 3 . | ||
| 336 | The parameters and return value of | ||
| 337 | .Fa callback_ctrl | ||
| 338 | have the same meaning as for | ||
| 339 | .Xr BIO_callback_ctrl 3 . | ||
| 269 | .Sh RETURN VALUES | 340 | .Sh RETURN VALUES |
| 341 | .Fn BIO_get_new_index | ||
| 342 | returns the new BIO type value or \-1 if an error occurs. | ||
| 343 | .Pp | ||
| 270 | .Fn BIO_meth_new | 344 | .Fn BIO_meth_new |
| 271 | returns the new | 345 | returns the new |
| 272 | .Vt BIO_METHOD | 346 | .Vt BIO_METHOD |
| @@ -278,6 +352,10 @@ The | |||
| 278 | .Fn BIO_meth_set_* | 352 | .Fn BIO_meth_set_* |
| 279 | functions return 1 on success or 0 on error. | 353 | functions return 1 on success or 0 on error. |
| 280 | Currently, they cannot fail. | 354 | Currently, they cannot fail. |
| 355 | .Pp | ||
| 356 | The | ||
| 357 | .Fn BIO_meth_get_* | ||
| 358 | functions return function pointers. | ||
| 281 | .Sh SEE ALSO | 359 | .Sh SEE ALSO |
| 282 | .Xr BIO_ctrl 3 , | 360 | .Xr BIO_ctrl 3 , |
| 283 | .Xr BIO_find_type 3 , | 361 | .Xr BIO_find_type 3 , |
