diff options
author | schwarze <> | 2021-11-27 16:18:03 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-27 16:18:03 +0000 |
commit | c3aca6e6e8c5c8ce213f793a81edea6aff154df1 (patch) | |
tree | 6f4395326854d5ea9566643d009eeac3190233dd | |
parent | cbb1afa6429df7a3087dd6a337b730e5304ed3bb (diff) | |
download | openbsd-c3aca6e6e8c5c8ce213f793a81edea6aff154df1.tar.gz openbsd-c3aca6e6e8c5c8ce213f793a81edea6aff154df1.tar.bz2 openbsd-c3aca6e6e8c5c8ce213f793a81edea6aff154df1.zip |
new manual page BIO_f_asn1(3)
-rw-r--r-- | src/lib/libcrypto/man/BIO_f_asn1.3 | 228 | ||||
-rw-r--r-- | src/lib/libcrypto/man/BIO_new.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
3 files changed, 233 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/BIO_f_asn1.3 b/src/lib/libcrypto/man/BIO_f_asn1.3 new file mode 100644 index 0000000000..199ba5e9d0 --- /dev/null +++ b/src/lib/libcrypto/man/BIO_f_asn1.3 | |||
@@ -0,0 +1,228 @@ | |||
1 | .\" $OpenBSD: BIO_f_asn1.3,v 1.1 2021/11/27 16:18:03 schwarze Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | ||
4 | .\" | ||
5 | .\" Permission to use, copy, modify, and distribute this software for any | ||
6 | .\" purpose with or without fee is hereby granted, provided that the above | ||
7 | .\" copyright notice and this permission notice appear in all copies. | ||
8 | .\" | ||
9 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
10 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
11 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
12 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
13 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
16 | .\" | ||
17 | .Dd $Mdocdate: November 27 2021 $ | ||
18 | .Dt BIO_F_ASN1 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm BIO_f_asn1 , | ||
22 | .Nm asn1_ps_func , | ||
23 | .Nm BIO_asn1_set_prefix , | ||
24 | .Nm BIO_asn1_get_prefix , | ||
25 | .Nm BIO_asn1_set_suffix , | ||
26 | .Nm BIO_asn1_get_suffix | ||
27 | .Nd BER-encoding filter BIO | ||
28 | .Sh SYNOPSIS | ||
29 | .In openssl/asn1.h | ||
30 | .Ft const BIO_METHOD * | ||
31 | .Fn BIO_f_asn1 void | ||
32 | .In openssl/bio.h | ||
33 | .Ft typedef int | ||
34 | .Fo asn1_ps_func | ||
35 | .Fa "BIO *bio" | ||
36 | .Fa "unsigned char **pbuf" | ||
37 | .Fa "int *plen" | ||
38 | .Fa "void *parg" | ||
39 | .Fc | ||
40 | .Ft int | ||
41 | .Fo BIO_asn1_set_prefix | ||
42 | .Fa "BIO *chain" | ||
43 | .Fa "asn1_ps_func *prefix" | ||
44 | .Fa "asn1_ps_func *prefix_free" | ||
45 | .Fc | ||
46 | .Ft int | ||
47 | .Fo BIO_asn1_get_prefix | ||
48 | .Fa "BIO *chain" | ||
49 | .Fa "asn1_ps_func **pprefix" | ||
50 | .Fa "asn1_ps_func **pprefix_free" | ||
51 | .Fc | ||
52 | .Ft int | ||
53 | .Fo BIO_asn1_set_suffix | ||
54 | .Fa "BIO *chain" | ||
55 | .Fa "asn1_ps_func *suffix" | ||
56 | .Fa "asn1_ps_func *suffix_free" | ||
57 | .Fc | ||
58 | .Ft int | ||
59 | .Fo BIO_asn1_get_suffix | ||
60 | .Fa "BIO *chain" | ||
61 | .Fa "asn1_ps_func **psuffix" | ||
62 | .Fa "asn1_ps_func **psuffix_free" | ||
63 | .Fc | ||
64 | .Sh DESCRIPTION | ||
65 | .Fn BIO_f_asn1 | ||
66 | returns the | ||
67 | .Qq asn1 | ||
68 | BIO method. | ||
69 | BIOs created from it with | ||
70 | .Xr BIO_new 3 | ||
71 | are filter BIOs intended to BER-encode data written to them | ||
72 | and pass the encoded data on to the next BIO in the chain. | ||
73 | Such BIOs operate as follows: | ||
74 | .Bl -hang -width 1n | ||
75 | .It Xr BIO_method_type 3 | ||
76 | returns | ||
77 | .Dv BIO_TYPE_ASN1 . | ||
78 | .It Xr BIO_method_name 3 | ||
79 | returns a pointer to the static string | ||
80 | .Qq asn1 . | ||
81 | .It Xr BIO_write 3 | ||
82 | writes the DER encoding of an ASN.1 OCTET STRING with the | ||
83 | .Fa len | ||
84 | content octets in | ||
85 | .Fa buf | ||
86 | to the next BIO in the chain. | ||
87 | .Pp | ||
88 | If a | ||
89 | .Fa prefix | ||
90 | function was installed with | ||
91 | .Fn BIO_asn1_set_prefix , | ||
92 | that function is called before writing the object. | ||
93 | It may for example produce additional output. | ||
94 | If it fails, writing fails. | ||
95 | .Pp | ||
96 | If a | ||
97 | .Fa prefix_free | ||
98 | function was installed as well, that function is called | ||
99 | after writing any output produced by | ||
100 | .Fa prefix | ||
101 | but before writing the object. | ||
102 | Failure of | ||
103 | .Fa prefix_free | ||
104 | is silently ignored. | ||
105 | .It Xr BIO_puts 3 | ||
106 | operates like | ||
107 | .Xr BIO_write 3 | ||
108 | but uses the | ||
109 | .Xr strlen 3 | ||
110 | of | ||
111 | .Fa buf | ||
112 | instead of a | ||
113 | .Fa len | ||
114 | argument. | ||
115 | .It Xr BIO_flush 3 | ||
116 | calls the | ||
117 | .Fa suffix | ||
118 | callback function, if any. | ||
119 | If that produces any output, it calls the | ||
120 | .Fa suffix_free | ||
121 | callback function, if any, silently ignoring failure. | ||
122 | Finally, it calls | ||
123 | .Xr BIO_flush 3 | ||
124 | on the next BIO in the chain. | ||
125 | It fails if no data was previously written or if the | ||
126 | .Fa suffix | ||
127 | callback, writing, or | ||
128 | .Xr BIO_flush 3 | ||
129 | on the next BIO fail. | ||
130 | .It Xr BIO_ctrl 3 | ||
131 | with a | ||
132 | .Fa cmd | ||
133 | of | ||
134 | .Dv BIO_C_SET_EX_ARG | ||
135 | stores the pointer | ||
136 | .Fa parg | ||
137 | internally such that it will be passed to the | ||
138 | .Fn asn1_ps_func | ||
139 | callback functions. | ||
140 | With a | ||
141 | .Fa cmd | ||
142 | of | ||
143 | .Dv BIO_C_GET_EX_ARG , | ||
144 | it retrieves that pointer, storing it in | ||
145 | .Pf * Fa parg . | ||
146 | The commands | ||
147 | .Dv BIO_C_SET_PREFIX , | ||
148 | .Dv BIO_C_GET_PREFIX , | ||
149 | .Dv BIO_C_SET_SUFFIX , | ||
150 | .Dv BIO_C_GET_SUFFIX , | ||
151 | and | ||
152 | .Dv BIO_CTRL_FLUSH | ||
153 | are used internally to implement | ||
154 | .Fn BIO_asn1_set_prefix , | ||
155 | .Fn BIO_asn1_get_prefix , | ||
156 | .Fn BIO_asn1_set_suffix , | ||
157 | .Fn BIO_asn1_get_suffix | ||
158 | and | ||
159 | .Xr BIO_flush 3 | ||
160 | and are not intended for use by application programs. | ||
161 | Other commands are merely forwarded to the next BIO in the chain. | ||
162 | .It Xo | ||
163 | .Xr BIO_read 3 , | ||
164 | .Xr BIO_gets 3 , | ||
165 | and | ||
166 | .Xr BIO_callback_ctrl 3 | ||
167 | .Xc | ||
168 | merely call the same function on the next BIO in the chain. | ||
169 | .El | ||
170 | .Pp | ||
171 | If the above description of a function mentions the next BIO in the | ||
172 | chain, that function fails if the asn1 BIO is the last BIO in the chain. | ||
173 | .Pp | ||
174 | .Fn BIO_asn1_set_prefix | ||
175 | and | ||
176 | .Fn BIO_asn1_get_prefix | ||
177 | install and retrieve the | ||
178 | .Fa prefix | ||
179 | and | ||
180 | .Fa prefix_free | ||
181 | callback functions in and from the first asn1 BIO in the given | ||
182 | .Fa chain . | ||
183 | Similarly, | ||
184 | .Fn BIO_asn1_set_suffix | ||
185 | and | ||
186 | .Fn BIO_asn1_get_suffix | ||
187 | install and retrieve the | ||
188 | .Fa suffix | ||
189 | and | ||
190 | .Fa suffix_free | ||
191 | callback functions. | ||
192 | Passing a | ||
193 | .Dv NULL | ||
194 | pointer for any of the | ||
195 | .Fn asn1_ps_func | ||
196 | arguments disables that particular callback. | ||
197 | .Sh RETURN VALUES | ||
198 | .Fn BIO_f_asn1 | ||
199 | always returns a pointer to a static built-in object. | ||
200 | .Pp | ||
201 | Functions of the type | ||
202 | .Fn asn1_ps_func | ||
203 | are supposed to return 1 on success or 0 on failure. | ||
204 | .Pp | ||
205 | .Fn BIO_asn1_set_prefix , | ||
206 | .Fn BIO_asn1_get_prefix , | ||
207 | .Fn BIO_asn1_set_suffix , | ||
208 | and | ||
209 | .Fn BIO_asn1_get_suffix | ||
210 | return 1 on success or 0 if | ||
211 | .Fa chain | ||
212 | is a | ||
213 | .Dv NULL | ||
214 | pointer or does not contain any asn1 BIO. | ||
215 | They may return \-2 if a BIO is encountered in the | ||
216 | .Fa chain | ||
217 | that is not properly initialized. | ||
218 | .Sh SEE ALSO | ||
219 | .Xr ASN1_put_object 3 , | ||
220 | .Xr BIO_ctrl 3 , | ||
221 | .Xr BIO_new 3 , | ||
222 | .Xr BIO_next 3 , | ||
223 | .Xr BIO_write 3 , | ||
224 | .Xr i2d_ASN1_OCTET_STRING 3 | ||
225 | .Sh HISTORY | ||
226 | These functions first appeared in OpenSSL 1.0.0 | ||
227 | and have been available since | ||
228 | .Ox 4.9 . | ||
diff --git a/src/lib/libcrypto/man/BIO_new.3 b/src/lib/libcrypto/man/BIO_new.3 index e7c08c99f1..17f5a708e8 100644 --- a/src/lib/libcrypto/man/BIO_new.3 +++ b/src/lib/libcrypto/man/BIO_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: BIO_new.3,v 1.21 2021/07/10 15:56:18 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_new.3,v 1.22 2021/11/27 16:18:03 schwarze Exp $ |
2 | .\" full merge up to: | 2 | .\" full merge up to: |
3 | .\" OpenSSL man3/BIO_new.pod fb46be03 Feb 26 11:51:31 2016 +0000 | 3 | .\" OpenSSL man3/BIO_new.pod fb46be03 Feb 26 11:51:31 2016 +0000 |
4 | .\" OpenSSL man7/bio.pod 631c37be Dec 12 16:56:50 2017 +0100 | 4 | .\" OpenSSL man7/bio.pod 631c37be Dec 12 16:56:50 2017 +0100 |
@@ -52,7 +52,7 @@ | |||
52 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 52 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
53 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | .\" | 54 | .\" |
55 | .Dd $Mdocdate: July 10 2021 $ | 55 | .Dd $Mdocdate: November 27 2021 $ |
56 | .Dt BIO_NEW 3 | 56 | .Dt BIO_NEW 3 |
57 | .Os | 57 | .Os |
58 | .Sh NAME | 58 | .Sh NAME |
@@ -230,6 +230,7 @@ Create a memory BIO: | |||
230 | .Sh SEE ALSO | 230 | .Sh SEE ALSO |
231 | .Xr BIO_ctrl 3 , | 231 | .Xr BIO_ctrl 3 , |
232 | .Xr BIO_dump 3 , | 232 | .Xr BIO_dump 3 , |
233 | .Xr BIO_f_asn1 3 , | ||
233 | .Xr BIO_f_base64 3 , | 234 | .Xr BIO_f_base64 3 , |
234 | .Xr BIO_f_buffer 3 , | 235 | .Xr BIO_f_buffer 3 , |
235 | .Xr BIO_f_cipher 3 , | 236 | .Xr BIO_f_cipher 3 , |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 6a0d65cb85..6d5f8d982b 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.220 2021/11/22 16:19:54 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.221 2021/11/27 16:18:03 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -35,6 +35,7 @@ MAN= \ | |||
35 | BF_set_key.3 \ | 35 | BF_set_key.3 \ |
36 | BIO_ctrl.3 \ | 36 | BIO_ctrl.3 \ |
37 | BIO_dump.3 \ | 37 | BIO_dump.3 \ |
38 | BIO_f_asn1.3 \ | ||
38 | BIO_f_base64.3 \ | 39 | BIO_f_base64.3 \ |
39 | BIO_f_buffer.3 \ | 40 | BIO_f_buffer.3 \ |
40 | BIO_f_cipher.3 \ | 41 | BIO_f_cipher.3 \ |