diff options
author | schwarze <> | 2021-11-21 15:11:01 +0000 |
---|---|---|
committer | schwarze <> | 2021-11-21 15:11:01 +0000 |
commit | 88e2eaa6b7b526aab9df534bcd58efff97058393 (patch) | |
tree | 28499a04b5ac33bae45d2efd5e7c528f69662de2 /src | |
parent | ff6fd818e90db619298226b17102f94cb10a855c (diff) | |
download | openbsd-88e2eaa6b7b526aab9df534bcd58efff97058393.tar.gz openbsd-88e2eaa6b7b526aab9df534bcd58efff97058393.tar.bz2 openbsd-88e2eaa6b7b526aab9df534bcd58efff97058393.zip |
new manual page d2i_ASN1_BOOLEAN(3) also documenting i2d_ASN1_BOOLEAN(3)
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/ASN1_TYPE_get.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASN1_item_new.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASN1_put_object.3 | 5 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 | 126 |
5 files changed, 137 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/ASN1_TYPE_get.3 b/src/lib/libcrypto/man/ASN1_TYPE_get.3 index 284ad61b34..6a7d761f94 100644 --- a/src/lib/libcrypto/man/ASN1_TYPE_get.3 +++ b/src/lib/libcrypto/man/ASN1_TYPE_get.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.12 2021/07/11 19:03:45 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.13 2021/11/21 15:11:01 schwarze Exp $ |
2 | .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 | 2 | .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
@@ -65,7 +65,7 @@ | |||
65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
67 | .\" | 67 | .\" |
68 | .Dd $Mdocdate: July 11 2021 $ | 68 | .Dd $Mdocdate: November 21 2021 $ |
69 | .Dt ASN1_TYPE_GET 3 | 69 | .Dt ASN1_TYPE_GET 3 |
70 | .Os | 70 | .Os |
71 | .Sh NAME | 71 | .Sh NAME |
@@ -283,6 +283,7 @@ returns 0 for a match or non-zero for a mismatch. | |||
283 | .Xr ASN1_STRING_dup 3 , | 283 | .Xr ASN1_STRING_dup 3 , |
284 | .Xr ASN1_STRING_new 3 , | 284 | .Xr ASN1_STRING_new 3 , |
285 | .Xr crypto 3 , | 285 | .Xr crypto 3 , |
286 | .Xr d2i_ASN1_BOOLEAN 3 , | ||
286 | .Xr d2i_ASN1_NULL 3 , | 287 | .Xr d2i_ASN1_NULL 3 , |
287 | .Xr d2i_ASN1_SEQUENCE_ANY 3 , | 288 | .Xr d2i_ASN1_SEQUENCE_ANY 3 , |
288 | .Xr d2i_ASN1_TYPE 3 , | 289 | .Xr d2i_ASN1_TYPE 3 , |
diff --git a/src/lib/libcrypto/man/ASN1_item_new.3 b/src/lib/libcrypto/man/ASN1_item_new.3 index 12340c7443..6e36e86c6d 100644 --- a/src/lib/libcrypto/man/ASN1_item_new.3 +++ b/src/lib/libcrypto/man/ASN1_item_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_item_new.3,v 1.8 2021/11/15 11:51:09 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_item_new.3,v 1.9 2021/11/21 15:11:01 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2016, 2018 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2016, 2018 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 15 2021 $ | 17 | .Dd $Mdocdate: November 21 2021 $ |
18 | .Dt ASN1_ITEM_NEW 3 | 18 | .Dt ASN1_ITEM_NEW 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -112,6 +112,7 @@ is returned and an error code can be retrieved with | |||
112 | .Xr ASN1_item_sign 3 , | 112 | .Xr ASN1_item_sign 3 , |
113 | .Xr ASN1_item_verify 3 , | 113 | .Xr ASN1_item_verify 3 , |
114 | .Xr ASN1_TYPE_new 3 , | 114 | .Xr ASN1_TYPE_new 3 , |
115 | .Xr d2i_ASN1_BOOLEAN 3 , | ||
115 | .Xr d2i_ASN1_NULL 3 , | 116 | .Xr d2i_ASN1_NULL 3 , |
116 | .Xr OBJ_nid2obj 3 | 117 | .Xr OBJ_nid2obj 3 |
117 | .Sh HISTORY | 118 | .Sh HISTORY |
diff --git a/src/lib/libcrypto/man/ASN1_put_object.3 b/src/lib/libcrypto/man/ASN1_put_object.3 index f1f0021fe5..e69550f0d2 100644 --- a/src/lib/libcrypto/man/ASN1_put_object.3 +++ b/src/lib/libcrypto/man/ASN1_put_object.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASN1_put_object.3,v 1.1 2019/08/26 11:41:31 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_put_object.3,v 1.2 2021/11/21 15:11:01 schwarze Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2019 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2019 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: August 26 2019 $ | 17 | .Dd $Mdocdate: November 21 2021 $ |
18 | .Dt ASN1_PUT_OBJECT 3 | 18 | .Dt ASN1_PUT_OBJECT 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -106,6 +106,7 @@ returns the number of bytes written, which is always 2. | |||
106 | .Sh SEE ALSO | 106 | .Sh SEE ALSO |
107 | .Xr ASN1_item_i2d 3 , | 107 | .Xr ASN1_item_i2d 3 , |
108 | .Xr ASN1_TYPE_get 3 , | 108 | .Xr ASN1_TYPE_get 3 , |
109 | .Xr i2d_ASN1_BOOLEAN 3 , | ||
109 | .Xr i2d_ASN1_NULL 3 , | 110 | .Xr i2d_ASN1_NULL 3 , |
110 | .Xr i2d_ASN1_OBJECT 3 , | 111 | .Xr i2d_ASN1_OBJECT 3 , |
111 | .Xr i2d_ASN1_OCTET_STRING 3 , | 112 | .Xr i2d_ASN1_OCTET_STRING 3 , |
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index 5d3a7d3d23..10f841bd8d 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.217 2021/11/19 16:00:54 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.218 2021/11/21 15:11:01 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -368,6 +368,7 @@ MAN= \ | |||
368 | X509at_get_attr.3 \ | 368 | X509at_get_attr.3 \ |
369 | X509v3_get_ext_by_NID.3 \ | 369 | X509v3_get_ext_by_NID.3 \ |
370 | crypto.3 \ | 370 | crypto.3 \ |
371 | d2i_ASN1_BOOLEAN.3 \ | ||
371 | d2i_ASN1_NULL.3 \ | 372 | d2i_ASN1_NULL.3 \ |
372 | d2i_ASN1_OBJECT.3 \ | 373 | d2i_ASN1_OBJECT.3 \ |
373 | d2i_ASN1_OCTET_STRING.3 \ | 374 | d2i_ASN1_OCTET_STRING.3 \ |
diff --git a/src/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 b/src/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 new file mode 100644 index 0000000000..ecd768f081 --- /dev/null +++ b/src/lib/libcrypto/man/d2i_ASN1_BOOLEAN.3 | |||
@@ -0,0 +1,126 @@ | |||
1 | .\" $OpenBSD: d2i_ASN1_BOOLEAN.3,v 1.1 2021/11/21 15:11:01 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 21 2021 $ | ||
18 | .Dt D2I_ASN1_BOOLEAN 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm d2i_ASN1_BOOLEAN , | ||
22 | .Nm i2d_ASN1_BOOLEAN | ||
23 | .Nd decode and encode an ASN.1 BOOLEAN value | ||
24 | .Sh SYNOPSIS | ||
25 | .In openssl/asn1.h | ||
26 | .Bd -unfilled | ||
27 | typedef int ASN1_BOOLEAN; | ||
28 | .Ed | ||
29 | .Pp | ||
30 | .Ft int | ||
31 | .Fo d2i_ASN1_BOOLEAN | ||
32 | .Fa "int *val_out" | ||
33 | .Fa "const unsigned char **der_in" | ||
34 | .Fa "long length" | ||
35 | .Fc | ||
36 | .Ft int | ||
37 | .Fo i2d_ASN1_BOOLEAN | ||
38 | .Fa "int val_in" | ||
39 | .Fa "unsigned char **der_out" | ||
40 | .Fc | ||
41 | .Sh DESCRIPTION | ||
42 | These functions decode and encode | ||
43 | an ASN.1 value TRUE or FALSE of the type BOOLEAN. | ||
44 | In contrast to most other ASN.1 types, | ||
45 | the library does not represent the BOOLEAN type by a structure. | ||
46 | Instead, | ||
47 | .Vt ASN1_BOOLEAN | ||
48 | is simply an alias for the type | ||
49 | .Vt int . | ||
50 | .Pp | ||
51 | .Fn d2i_ASN1_BOOLEAN | ||
52 | verifies that the BER-encoded value at | ||
53 | .Pf * Fa der_in | ||
54 | is of the type BOOLEAN | ||
55 | and that the number encoded in the length octets is 1. | ||
56 | At most | ||
57 | .Fa length | ||
58 | bytes are inspected. | ||
59 | .Pp | ||
60 | Unless | ||
61 | .Fa val_out | ||
62 | is a | ||
63 | .Dv NULL | ||
64 | pointer, it copies the integer value of the single content octet to | ||
65 | .Pf * Fa val_out . | ||
66 | In case of success, | ||
67 | .Pf * Fa der_in | ||
68 | is advanced by three bytes to the byte after the content octet. | ||
69 | .Pp | ||
70 | .Fn i2d_ASN1_BOOLEAN | ||
71 | encodes an ASN.1 value of the type BOOLEAN using DER. | ||
72 | Specifically, unless | ||
73 | .Fa der_out | ||
74 | is a | ||
75 | .Dv NULL | ||
76 | pointer, it writes the identifier octet for the type BOOLEAN, | ||
77 | 0x01, the single length octet 0x01, one single content octet containing | ||
78 | .Fa val_in , | ||
79 | and no end-of-content octets to | ||
80 | .Pf * Fa der_out | ||
81 | and advances the pointer | ||
82 | .Pf * Fa der_out | ||
83 | by three bytes to the byte after the content octet. | ||
84 | Making sure that three bytes can be written to | ||
85 | .Pf * Fa der_out | ||
86 | is the responsibility of the caller. | ||
87 | .Pp | ||
88 | If | ||
89 | .Fa val_in | ||
90 | is 0, it encodes the FALSE value. | ||
91 | If | ||
92 | .Fa val_in | ||
93 | is in the range from 1 to 255 inclusive, it encodes the TRUE value. | ||
94 | .Sh RETURN VALUES | ||
95 | In case of success, | ||
96 | .Fn d2i_ASN1_BOOLEAN | ||
97 | returns the integer value of the content octet. | ||
98 | The number 0 represents the FALSE value and any number in the range | ||
99 | from 1 to 255 inclusive represents the TRUE value. | ||
100 | If the | ||
101 | .Fa length | ||
102 | argument is less than 3, if parsing fails, if the ASN.1 object at | ||
103 | .Pf * Fa der_in | ||
104 | is not of the type BOOLEAN, or if the number of content octets is not 1, | ||
105 | .Fn d2i_ASN1_BOOLEAN | ||
106 | returns \-1 to indicate the error. | ||
107 | .Pp | ||
108 | .Fn i2d_ASN1_BOOLEAN | ||
109 | always returns 3, which is the number of bytes in the BER encoding | ||
110 | of an ASN.1 BOOLEAN value. | ||
111 | .Sh SEE ALSO | ||
112 | .Xr ASN1_get_object 3 , | ||
113 | .Xr ASN1_item_d2i 3 , | ||
114 | .Xr ASN1_put_object 3 | ||
115 | .Sh HISTORY | ||
116 | .Fn d2i_ASN1_BOOLEAN | ||
117 | and | ||
118 | .Fn i2d_ASN1_BOOLEAN | ||
119 | first appeared in SSLeay 0.6.2 and have been available since | ||
120 | .Ox 2.4 . | ||
121 | .Sh CAVEATS | ||
122 | The behaviour of | ||
123 | .Fn i2d_ASN1_BOOLEAN | ||
124 | is unspecified if | ||
125 | .Fa val_in | ||
126 | is negative or larger than 255. | ||