diff options
author | schwarze <> | 2016-12-06 12:54:19 +0000 |
---|---|---|
committer | schwarze <> | 2016-12-06 12:54:19 +0000 |
commit | 3472b6f5a290febbe7727d2886dce3ddeb0798e4 (patch) | |
tree | ff8829e73684df79b569988da2fa0850acaa867f /src/lib/libcrypto/man/BIO_new.3 | |
parent | eea7454d5f0937c3ffb6642ac5b1ba135b172e29 (diff) | |
download | openbsd-3472b6f5a290febbe7727d2886dce3ddeb0798e4.tar.gz openbsd-3472b6f5a290febbe7727d2886dce3ddeb0798e4.tar.bz2 openbsd-3472b6f5a290febbe7727d2886dce3ddeb0798e4.zip |
We don't want section 3 manual pages with names that do not correspond
to functions, so delete the BIO(3) manual page and merge its content
into BIO_new(3) and BIO_push(3).
Sort the content of BIO_new(3) into a logical order
and improve the wording in various ways.
Add the required cross references to BIO_push(3).
Diffstat (limited to 'src/lib/libcrypto/man/BIO_new.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_new.3 | 131 |
1 files changed, 89 insertions, 42 deletions
diff --git a/src/lib/libcrypto/man/BIO_new.3 b/src/lib/libcrypto/man/BIO_new.3 index 59a5b37056..654f4e844a 100644 --- a/src/lib/libcrypto/man/BIO_new.3 +++ b/src/lib/libcrypto/man/BIO_new.3 | |||
@@ -1,5 +1,6 @@ | |||
1 | .\" $OpenBSD: BIO_new.3,v 1.5 2016/11/18 18:43:05 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_new.3,v 1.6 2016/12/06 12:54:19 schwarze Exp $ |
2 | .\" OpenSSL ca3a82c3 Mar 25 11:31:18 2015 -0400 | 2 | .\" OpenSSL doc/man3/BIO_new.pod ca3a82c3 Mar 25 11:31:18 2015 -0400 |
3 | .\" OpenSSL doc/man7/bio.pod a9c85cea Nov 11 09:33:55 2016 +0100 | ||
3 | .\" | 4 | .\" |
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | 5 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. |
5 | .\" Copyright (c) 2000, 2015, 2016 The OpenSSL Project. All rights reserved. | 6 | .\" Copyright (c) 2000, 2015, 2016 The OpenSSL Project. All rights reserved. |
@@ -48,7 +49,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 49 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 50 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 51 | .\" |
51 | .Dd $Mdocdate: November 18 2016 $ | 52 | .Dd $Mdocdate: December 6 2016 $ |
52 | .Dt BIO_NEW 3 | 53 | .Dt BIO_NEW 3 |
53 | .Os | 54 | .Os |
54 | .Sh NAME | 55 | .Sh NAME |
@@ -57,7 +58,7 @@ | |||
57 | .Nm BIO_free , | 58 | .Nm BIO_free , |
58 | .Nm BIO_vfree , | 59 | .Nm BIO_vfree , |
59 | .Nm BIO_free_all | 60 | .Nm BIO_free_all |
60 | .Nd BIO allocation and freeing functions | 61 | .Nd construct and destruct I/O abstraction objects |
61 | .Sh SYNOPSIS | 62 | .Sh SYNOPSIS |
62 | .In openssl/bio.h | 63 | .In openssl/bio.h |
63 | .Ft BIO * | 64 | .Ft BIO * |
@@ -82,78 +83,124 @@ | |||
82 | .Fa "BIO *a" | 83 | .Fa "BIO *a" |
83 | .Fc | 84 | .Fc |
84 | .Sh DESCRIPTION | 85 | .Sh DESCRIPTION |
86 | A | ||
87 | .Vt BIO | ||
88 | is an I/O abstraction object, hiding many of the underlying I/O | ||
89 | details from an application. | ||
90 | If an application uses BIOs for its I/O, it can transparently handle | ||
91 | SSL connections, unencrypted network connections, and file I/O. | ||
92 | .Pp | ||
85 | The | 93 | The |
86 | .Fn BIO_new | 94 | .Fn BIO_new |
87 | function returns a new BIO using method | 95 | function constructs a new |
96 | .Vt BIO | ||
97 | using the method | ||
88 | .Fa type . | 98 | .Fa type . |
99 | There are two groups of BIO types, source/sink BIOs and a filter BIOs. | ||
100 | .Pp | ||
101 | Source/sink BIOs provide input or consume output. | ||
102 | Examples include socket BIOs and file BIOs. | ||
103 | .Pp | ||
104 | Filter BIOs take data from one BIO and pass it through to another, | ||
105 | or to the application, forming a chain of BIOs. | ||
106 | The data may be left unmodified (for example by a message digest BIO) | ||
107 | or translated (for example by an encryption BIO). | ||
108 | The effect of a filter BIO may change according to the I/O operation | ||
109 | it is performing: for example an encryption BIO will encrypt data | ||
110 | if it is written to and decrypt data if it is read from. | ||
111 | .Pp | ||
112 | Some BIOs (such as memory BIOs) can be used immediately after calling | ||
113 | .Fn BIO_new . | ||
114 | Others (such as file BIOs) need some additional initialization, and | ||
115 | utility functions exists to construct and initialize such BIOs. | ||
116 | .Pp | ||
117 | Normally the | ||
118 | .Fa type | ||
119 | argument is supplied by a function which returns a pointer to a | ||
120 | .Vt BIO_METHOD . | ||
121 | There is a naming convention for such functions: | ||
122 | the methods for source/sink BIOs are called | ||
123 | .Fn BIO_s_* | ||
124 | and those for filter BIOs | ||
125 | .Fn BIO_f_* . | ||
89 | .Pp | 126 | .Pp |
90 | .Fn BIO_set | 127 | .Fn BIO_set |
91 | sets the method of an already existing BIO. | 128 | sets the method of an already existing BIO. |
92 | .Pp | 129 | .Pp |
93 | .Fn BIO_free | 130 | .Fn BIO_free |
94 | frees up a single BIO; | 131 | and |
95 | .Fn BIO_vfree | 132 | .Fn BIO_vfree |
96 | also frees up a single BIO, but it does not return a value. | 133 | destruct a single BIO, which may also have some effect on the |
134 | underlying I/O structure, for example it may close the file being | ||
135 | referred to under certain circumstances. | ||
97 | If | 136 | If |
98 | .Fa a | 137 | .Fa a |
99 | is a | 138 | is a |
100 | .Dv NULL | 139 | .Dv NULL |
101 | pointer, no action occurs. | 140 | pointer, no action occurs. |
102 | Calling | 141 | If |
103 | .Fn BIO_free | 142 | .Fn BIO_free |
104 | may also have some effect on the underlying I/O structure, | 143 | is called on a BIO chain, it will only destruct one BIO, |
105 | for example it may close the file being | 144 | resulting in a memory leak. |
106 | referred to under certain circumstances. | ||
107 | For more details see the individual | ||
108 | .Vt BIO_METHOD | ||
109 | descriptions. | ||
110 | .Pp | 145 | .Pp |
111 | .Fn BIO_free_all | 146 | .Fn BIO_free_all |
112 | frees up an entire BIO chain. | 147 | destructs an entire BIO chain. |
113 | It does not halt if an error occurs | 148 | It does not halt if an error occurs |
114 | freeing up an individual BIO in the chain. | 149 | destructing an individual BIO in the chain. |
115 | If | 150 | If |
116 | .Fa a | 151 | .Fa a |
117 | is a | 152 | is a |
118 | .Dv NULL | 153 | .Dv NULL |
119 | pointer, no action occurs. | 154 | pointer, no action occurs. |
120 | .Pp | ||
121 | Some BIOs (such as memory BIOs) can be used immediately after calling | ||
122 | .Fn BIO_new . | ||
123 | Others (such as file BIOs) need some additional initialization, and | ||
124 | frequently a utility function exists to create and initialize such BIOs. | ||
125 | .Pp | ||
126 | If | ||
127 | .Fn BIO_free | ||
128 | is called on a BIO chain, it will only free one BIO, | ||
129 | resulting in a memory leak. | ||
130 | .Pp | ||
131 | Calling | 155 | Calling |
132 | .Fn BIO_free_all | 156 | .Fn BIO_free_all |
133 | on a single BIO has the same effect as calling | 157 | on a single BIO has the same effect as |
134 | .Fn BIO_free | 158 | .Fn BIO_vfree . |
135 | on it other than the discarded return value. | ||
136 | .Pp | 159 | .Pp |
137 | Normally the | 160 | Common I/O functions are documented in |
138 | .Fa type | 161 | .Xr BIO_read 3 . |
139 | argument is supplied by a function which returns a pointer to a | 162 | Forming chains is explained in |
140 | .Vt BIO_METHOD . | 163 | .Xr BIO_push 3 , |
141 | There is a naming convention for such functions: | 164 | inspecting them in |
142 | a source/sink BIO is normally called | 165 | .Xr BIO_find_type 3 . |
143 | .Fn BIO_s_* | 166 | For more details about the different kinds of BIOs, see the individual |
144 | and a filter BIO | 167 | .Vt BIO_METHOD |
145 | .Fn BIO_f_* . | 168 | manual pages. |
146 | .Sh RETURN VALUES | 169 | .Sh RETURN VALUES |
147 | .Fn BIO_new | 170 | .Fn BIO_new |
148 | returns a newly created BIO or | 171 | returns a newly constructed |
172 | .Vt BIO | ||
173 | object or | ||
149 | .Dv NULL | 174 | .Dv NULL |
150 | if the call fails. | 175 | on failure. |
151 | .Pp | 176 | .Pp |
152 | .Fn BIO_set | 177 | .Fn BIO_set |
153 | and | 178 | and |
154 | .Fn BIO_free | 179 | .Fn BIO_free |
155 | return 1 for success and 0 for failure. | 180 | return 1 for success or 0 for failure. |
156 | .Sh EXAMPLES | 181 | .Sh EXAMPLES |
157 | Create a memory BIO: | 182 | Create a memory BIO: |
158 | .Pp | 183 | .Pp |
159 | .Dl BIO *mem = BIO_new(BIO_s_mem()); | 184 | .Dl BIO *mem = BIO_new(BIO_s_mem()); |
185 | .Sh SEE ALSO | ||
186 | .Xr BIO_ctrl 3 , | ||
187 | .Xr BIO_f_base64 3 , | ||
188 | .Xr BIO_f_buffer 3 , | ||
189 | .Xr BIO_f_cipher 3 , | ||
190 | .Xr BIO_f_md 3 , | ||
191 | .Xr BIO_f_null 3 , | ||
192 | .Xr BIO_f_ssl 3 , | ||
193 | .Xr BIO_get_ex_new_index.3 , | ||
194 | .Xr BIO_find_type 3 , | ||
195 | .Xr BIO_push 3 , | ||
196 | .Xr BIO_read 3 , | ||
197 | .Xr BIO_s_accept 3 , | ||
198 | .Xr BIO_s_bio 3 , | ||
199 | .Xr BIO_s_connect 3 , | ||
200 | .Xr BIO_s_fd 3 , | ||
201 | .Xr BIO_s_file 3 , | ||
202 | .Xr BIO_s_mem 3 , | ||
203 | .Xr BIO_s_null 3 , | ||
204 | .Xr BIO_s_socket 3 , | ||
205 | .Xr BIO_set_callback 3 , | ||
206 | .Xr BIO_should_retry 3 | ||