diff options
author | schwarze <> | 2021-12-12 17:31:18 +0000 |
---|---|---|
committer | schwarze <> | 2021-12-12 17:31:18 +0000 |
commit | b4ea0344211c6ebbf929b947a3167d064bb6fe1e (patch) | |
tree | a0d1185357f0317bef50e318bd2ea897a0295839 /src | |
parent | 9a4d074221a5da66d3f2315cd2728270ad598654 (diff) | |
download | openbsd-b4ea0344211c6ebbf929b947a3167d064bb6fe1e.tar.gz openbsd-b4ea0344211c6ebbf929b947a3167d064bb6fe1e.tar.bz2 openbsd-b4ea0344211c6ebbf929b947a3167d064bb6fe1e.zip |
New manual page providing a rudimentary description of BIO_new_NDEF(3).
The API surrounding this is so complicated and streaming is so rarely
used in practice that describing this in more detail is not a priority
right now. The documentation of the wrapper BIO_new_CMS(3) is also
rather vague, and BIO_new_PKCS7() isn't described at all so far.
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/BIO_f_asn1.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/BIO_new_CMS.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/BIO_new_NDEF.3 | 119 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 |
4 files changed, 127 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/BIO_f_asn1.3 b/src/lib/libcrypto/man/BIO_f_asn1.3 index 199ba5e9d0..3bf5a51204 100644 --- a/src/lib/libcrypto/man/BIO_f_asn1.3 +++ b/src/lib/libcrypto/man/BIO_f_asn1.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: BIO_f_asn1.3,v 1.1 2021/11/27 16:18:03 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_f_asn1.3,v 1.2 2021/12/12 17:31:18 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,7 +14,7 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 16 | .\" |
17 | .Dd $Mdocdate: November 27 2021 $ | 17 | .Dd $Mdocdate: December 12 2021 $ |
18 | .Dt BIO_F_ASN1 3 | 18 | .Dt BIO_F_ASN1 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -219,6 +219,7 @@ that is not properly initialized. | |||
219 | .Xr ASN1_put_object 3 , | 219 | .Xr ASN1_put_object 3 , |
220 | .Xr BIO_ctrl 3 , | 220 | .Xr BIO_ctrl 3 , |
221 | .Xr BIO_new 3 , | 221 | .Xr BIO_new 3 , |
222 | .Xr BIO_new_NDEF 3 , | ||
222 | .Xr BIO_next 3 , | 223 | .Xr BIO_next 3 , |
223 | .Xr BIO_write 3 , | 224 | .Xr BIO_write 3 , |
224 | .Xr i2d_ASN1_OCTET_STRING 3 | 225 | .Xr i2d_ASN1_OCTET_STRING 3 |
diff --git a/src/lib/libcrypto/man/BIO_new_CMS.3 b/src/lib/libcrypto/man/BIO_new_CMS.3 index a7c2c1b2c3..c1c47e3ad3 100644 --- a/src/lib/libcrypto/man/BIO_new_CMS.3 +++ b/src/lib/libcrypto/man/BIO_new_CMS.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: BIO_new_CMS.3,v 1.7 2019/11/02 15:39:46 schwarze Exp $ | 1 | .\" $OpenBSD: BIO_new_CMS.3,v 1.8 2021/12/12 17:31:18 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL df75c2bfc Dec 9 01:02:36 2018 +0100 | 2 | .\" full merge up to: OpenSSL df75c2bfc Dec 9 01:02:36 2018 +0100 |
3 | .\" | 3 | .\" |
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | 4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. |
@@ -48,7 +48,7 @@ | |||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
50 | .\" | 50 | .\" |
51 | .Dd $Mdocdate: November 2 2019 $ | 51 | .Dd $Mdocdate: December 12 2021 $ |
52 | .Dt BIO_NEW_CMS 3 | 52 | .Dt BIO_NEW_CMS 3 |
53 | .Os | 53 | .Os |
54 | .Sh NAME | 54 | .Sh NAME |
@@ -128,6 +128,7 @@ The error can be obtained from | |||
128 | .Xr ERR_get_error 3 . | 128 | .Xr ERR_get_error 3 . |
129 | .Sh SEE ALSO | 129 | .Sh SEE ALSO |
130 | .Xr BIO_new 3 , | 130 | .Xr BIO_new 3 , |
131 | .Xr BIO_new_NDEF 3 , | ||
131 | .Xr CMS_ContentInfo_new 3 , | 132 | .Xr CMS_ContentInfo_new 3 , |
132 | .Xr CMS_encrypt 3 , | 133 | .Xr CMS_encrypt 3 , |
133 | .Xr CMS_sign 3 | 134 | .Xr CMS_sign 3 |
diff --git a/src/lib/libcrypto/man/BIO_new_NDEF.3 b/src/lib/libcrypto/man/BIO_new_NDEF.3 new file mode 100644 index 0000000000..a89832da40 --- /dev/null +++ b/src/lib/libcrypto/man/BIO_new_NDEF.3 | |||
@@ -0,0 +1,119 @@ | |||
1 | .\" $OpenBSD: BIO_new_NDEF.3,v 1.1 2021/12/12 17:31:18 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: December 12 2021 $ | ||
18 | .Dt BIO_NEW_NDEF 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm BIO_new_NDEF | ||
22 | .Nd generic constructor for streaming BIO chains | ||
23 | .Sh SYNOPSIS | ||
24 | .In openssl/asn1.h | ||
25 | .Ft BIO * | ||
26 | .Fo BIO_new_NDEF | ||
27 | .Fa "BIO *out_bio" | ||
28 | .Fa "ASN1_VALUE *val_in" | ||
29 | .Fa "const ASN1_ITEM *it" | ||
30 | .Fc | ||
31 | .Sh DESCRIPTION | ||
32 | .Fn BIO_new_NDEF | ||
33 | is a wrapper around | ||
34 | .Xr BIO_new 3 | ||
35 | with a BIO | ||
36 | .Fa type | ||
37 | of | ||
38 | .Xr BIO_f_asn1 3 | ||
39 | that supports streaming by providing the following additional functionality. | ||
40 | .Pp | ||
41 | The data type | ||
42 | .Fa it | ||
43 | needs to support streaming. | ||
44 | Of the data types built into the library, currently only | ||
45 | .Vt CMS_ContentInfo | ||
46 | and | ||
47 | .Vt PKCS7 | ||
48 | support that. | ||
49 | The argument | ||
50 | .Fa val_in | ||
51 | needs to be of that type. | ||
52 | .Pp | ||
53 | A structure containing the following data is saved using | ||
54 | .Xr BIO_ctrl 3 | ||
55 | with an argument of | ||
56 | .Dv BIO_C_SET_EX_ARG | ||
57 | as described is | ||
58 | .Xr BIO_f_asn1 3 : | ||
59 | .Pp | ||
60 | .Bl -bullet -compact -offset indent | ||
61 | .It | ||
62 | the data type | ||
63 | .Fa it | ||
64 | .It | ||
65 | the input value | ||
66 | .Fa val_in | ||
67 | .It | ||
68 | a pointer to the | ||
69 | .Vt unsigned char * | ||
70 | content buffer of | ||
71 | .Fa val_in , | ||
72 | extracted using a type-specific callback function | ||
73 | .It | ||
74 | a pointer to the new asn1 BIO | ||
75 | .It | ||
76 | a pointer to the beginning of the BIO chain; | ||
77 | this may be the asn1 BIO itself, or one or more filter BIOs | ||
78 | may be prepended to it in a type-specific manner, | ||
79 | for example digest or encoding BIOs | ||
80 | .El | ||
81 | .Pp | ||
82 | In order to handle the output from the new asn1 BIO, the | ||
83 | .Fa out_bio | ||
84 | is appended to it using | ||
85 | .Xr BIO_push 3 . | ||
86 | The | ||
87 | .Fa out_bio | ||
88 | can be a single sink BIO or a BIO chain ending in a sink BIO. | ||
89 | .Pp | ||
90 | A built-in | ||
91 | .Fa prefix | ||
92 | function is installed with | ||
93 | .Xr BIO_asn1_set_prefix 3 | ||
94 | that encodes | ||
95 | .Fa val_in | ||
96 | using | ||
97 | .Xr ASN1_item_ndef_i2d 3 , | ||
98 | and a built-in | ||
99 | .Fa suffix | ||
100 | function is installed that finalizes the written structures | ||
101 | in a type-specific way. | ||
102 | .Sh RETURN VALUES | ||
103 | .Fn BIO_new_NDEF | ||
104 | returns a pointer to the beginning of the constructed BIO chain or | ||
105 | .Dv NULL | ||
106 | if | ||
107 | .Fa it | ||
108 | does not support streaming or if memory allocation fails. | ||
109 | .Sh SEE ALSO | ||
110 | .Xr ASN1_item_ndef_i2d 3 , | ||
111 | .Xr BIO_ctrl 3 , | ||
112 | .Xr BIO_f_asn1 3 , | ||
113 | .Xr BIO_new 3 , | ||
114 | .Xr BIO_new_CMS 3 , | ||
115 | .Xr BIO_push 3 | ||
116 | .Sh HISTORY | ||
117 | .Fn BIO_new_NDEF | ||
118 | first appeared in OpenSSL 1.0.0 and has been available since | ||
119 | .Ox 4.9 . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 91c763c8ed..aab725a0e9 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.222 2021/12/08 21:52:29 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.223 2021/12/12 17:31:18 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -48,6 +48,7 @@ MAN= \ | |||
48 | BIO_meth_new.3 \ | 48 | BIO_meth_new.3 \ |
49 | BIO_new.3 \ | 49 | BIO_new.3 \ |
50 | BIO_new_CMS.3 \ | 50 | BIO_new_CMS.3 \ |
51 | BIO_new_NDEF.3 \ | ||
51 | BIO_printf.3 \ | 52 | BIO_printf.3 \ |
52 | BIO_push.3 \ | 53 | BIO_push.3 \ |
53 | BIO_read.3 \ | 54 | BIO_read.3 \ |