summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-02-23 19:12:09 +0000
committerschwarze <>2018-02-23 19:12:09 +0000
commit3f40d68c169fc584c7316f635ca31daf0581c229 (patch)
tree2ee55a861bdae1ac8c96f1636602fc3a2f5bd801 /src
parent4767a3b0c03bdf9e17dde9d7b4c4d61eebccecc9 (diff)
downloadopenbsd-3f40d68c169fc584c7316f635ca31daf0581c229.tar.gz
openbsd-3f40d68c169fc584c7316f635ca31daf0581c229.tar.bz2
openbsd-3f40d68c169fc584c7316f635ca31daf0581c229.zip
In bio.h rev. 1.34 2018/02/20 17:15:27, jsing@ provided
BIO_get_new_index(3), in rev. 1.37 2018/02/20 18:13:31, tb@ provided BIO_meth_get_read(3), BIO_meth_get_puts(3), BIO_meth_get_gets(3), BIO_meth_get_ctrl(3), BIO_meth_get_create(3), and BIO_meth_get_destroy(3), and in rev. 1.38 2018/02/20 18:17:17 BIO_meth_get_callback_ctrl(3) and BIO_meth_set_callback_ctrl(3). BIO_meth_get_write(3) will become public with the next minor bump. Merge the documentation from OpenSSL, tweaked by me, OK tb@.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/BIO_meth_new.3100
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
129The 167The
130.Vt BIO_METHOD 168.Vt BIO_METHOD
@@ -142,7 +180,14 @@ creates a new
142.Vt BIO_METHOD 180.Vt BIO_METHOD
143structure. 181structure.
144It requires a unique integer 182It requires a unique integer
183.Fa type ;
184use
185.Fn BIO_get_new_index
186to get the value for
145.Fa type . 187.Fa type .
188Currently, the user can only create up to 127 different BIO types, and
189.Fa type
190is limited to the range 129\(en255.
146The 191The
147.Fa name 192.Fa name
148pointer is stored in the structure and will not be freed by 193pointer is stored in the structure and will not be freed by
@@ -174,10 +219,12 @@ for more information.
174is an alias for 219is 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 ,
178and 225and
179.Fn BIO_meth_set_read 226.Fn BIO_meth_set_read
180set the functions 227get and set the functions
181.Fa write 228.Fa write
182and 229and
183.Fa read 230.Fa read
@@ -197,8 +244,10 @@ have the same meaning as for
197and 244and
198.Xr BIO_read 3 . 245.Xr BIO_read 3 .
199.Pp 246.Pp
247.Fn BIO_meth_get_puts
248and
200.Fn BIO_meth_set_puts 249.Fn BIO_meth_set_puts
201sets the function 250get and set the function
202.Fa puts 251.Fa puts
203used for writing a NUL-terminated string to the 252used 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
209have the same meaning as for 258have 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
262and
212.Fn BIO_meth_set_gets 263.Fn BIO_meth_set_gets
213sets the function 264get and set the function
214.Fa gets 265.Fa gets
215used for reading a line of data to the 266used for reading a line of data from the
216.Vt BIO . 267.Vt BIO .
217This function is called from 268This 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
221have the same meaning as for 272have 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
276and
224.Fn BIO_meth_set_ctrl 277.Fn BIO_meth_set_ctrl
225sets the function 278get and set the function
226.Fa ctrl 279.Fa ctrl
227used for processing control messages in the 280used for processing control messages in the
228.Vt BIO . 281.Vt BIO .
@@ -233,8 +286,10 @@ The parameters and return value of
233have the same meaning as for 286have 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
290and
236.Fn BIO_meth_set_create 291.Fn BIO_meth_set_create
237sets a function 292get and set a function
238.Fa create 293.Fa create
239used while initializing a new instance of the 294used 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
248as the parameter to 303as the parameter to
249.Fa create . 304.Fa create .
250.Pp 305.Pp
306.Fn BIO_meth_get_destroy
307and
251.Fn BIO_meth_set_destroy 308.Fn BIO_meth_set_destroy
252sets a function 309get and set a function
253.Fa destroy 310.Fa destroy
254used while destroying an instance of a 311used 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
266The memory for the 323The memory for the
267.Vt BIO 324.Vt BIO
268itself must not be freed by this function. 325itself must not be freed by this function.
326.Pp
327.Fn BIO_meth_get_callback_ctrl
328and
329.Fn BIO_meth_set_callback_ctrl
330get and set the function
331.Fa callback_ctrl
332used for processing callback control messages in the
333.Vt BIO .
334This function is called from
335.Xr BIO_callback_ctrl 3 .
336The parameters and return value of
337.Fa callback_ctrl
338have 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
342returns the new BIO type value or \-1 if an error occurs.
343.Pp
270.Fn BIO_meth_new 344.Fn BIO_meth_new
271returns the new 345returns 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_*
279functions return 1 on success or 0 on error. 353functions return 1 on success or 0 on error.
280Currently, they cannot fail. 354Currently, they cannot fail.
355.Pp
356The
357.Fn BIO_meth_get_*
358functions 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 ,