diff options
author | tb <> | 2023-09-25 11:59:10 +0000 |
---|---|---|
committer | tb <> | 2023-09-25 11:59:10 +0000 |
commit | 3f17bba4834b5a146a55e937d801550cb1bc510e (patch) | |
tree | 13e2fe28314a3129ede1c7a60a4d98312f7ba20f /src | |
parent | d1e214b52051a9544479371367628d05cb9b7a1f (diff) | |
download | openbsd-3f17bba4834b5a146a55e937d801550cb1bc510e.tar.gz openbsd-3f17bba4834b5a146a55e937d801550cb1bc510e.tar.bz2 openbsd-3f17bba4834b5a146a55e937d801550cb1bc510e.zip |
New manual page documenting the usual four ASN.1 functions for both
ASRange and ASIdOrRange
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/ASIdentifiers_new.3 | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/ASRange_new.3 | 257 | ||||
-rw-r--r-- | src/lib/libcrypto/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libcrypto/man/X509_new.3 | 3 |
4 files changed, 263 insertions, 3 deletions
diff --git a/src/lib/libcrypto/man/ASIdentifiers_new.3 b/src/lib/libcrypto/man/ASIdentifiers_new.3 index 262c760f17..f6ab5e5aaf 100644 --- a/src/lib/libcrypto/man/ASIdentifiers_new.3 +++ b/src/lib/libcrypto/man/ASIdentifiers_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: ASIdentifiers_new.3,v 1.2 2023/09/25 11:12:08 tb Exp $ | 1 | .\" $OpenBSD: ASIdentifiers_new.3,v 1.3 2023/09/25 11:59:10 tb Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2021 Theo Buehler <tb@openbsd.org> | 3 | .\" Copyright (c) 2021 Theo Buehler <tb@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -105,6 +105,7 @@ on if a decoding or memory allocation error occurs. | |||
105 | returns the number of bytes successfully encoded | 105 | returns the number of bytes successfully encoded |
106 | or a value <= 0 if an error occurs. | 106 | or a value <= 0 if an error occurs. |
107 | .Sh SEE ALSO | 107 | .Sh SEE ALSO |
108 | .Xr ASRange_new 3 , | ||
108 | .Xr crypto 3 , | 109 | .Xr crypto 3 , |
109 | .Xr X509_new 3 , | 110 | .Xr X509_new 3 , |
110 | .Xr X509v3_asid_add_id_or_range 3 , | 111 | .Xr X509v3_asid_add_id_or_range 3 , |
diff --git a/src/lib/libcrypto/man/ASRange_new.3 b/src/lib/libcrypto/man/ASRange_new.3 new file mode 100644 index 0000000000..6aa33f2c79 --- /dev/null +++ b/src/lib/libcrypto/man/ASRange_new.3 | |||
@@ -0,0 +1,257 @@ | |||
1 | .\" $OpenBSD: ASRange_new.3,v 1.1 2023/09/25 11:59:10 tb Exp $ | ||
2 | .\" | ||
3 | .\" Copyright (c) 2023 Theo Buehler <tb@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: September 25 2023 $ | ||
18 | .Dt ASRANGE_NEW 3 | ||
19 | .Os | ||
20 | .Sh NAME | ||
21 | .Nm ASRange_new , | ||
22 | .Nm ASRange_free , | ||
23 | .Nm d2i_ASRange , | ||
24 | .Nm i2d_ASRange , | ||
25 | .Nm ASIdOrRange_new , | ||
26 | .Nm ASIdOrRange_free , | ||
27 | .Nm d2i_ASIdOrRange , | ||
28 | .Nm i2d_ASIdOrRange | ||
29 | .Nd Autonomous system identifiers and ranges | ||
30 | .Sh SYNOPSIS | ||
31 | .In openssl/x509v3.h | ||
32 | .Ft "ASRange *" | ||
33 | .Fn ASRange_new void | ||
34 | .Ft void | ||
35 | .Fn ASRange_free "ASRange *" | ||
36 | .Ft ASRange * | ||
37 | .Fo d2i_ASRange | ||
38 | .Fa "ASRange **asrange" | ||
39 | .Fa "const unsigned char **der_in" | ||
40 | .Fa "long length" | ||
41 | .Fc | ||
42 | .Ft int | ||
43 | .Fo i2d_ASRange | ||
44 | .Fa "ASRange *asrange" | ||
45 | .Fa "unsigned char **der_out" | ||
46 | .Fc | ||
47 | .Ft "ASIdOrRange *" | ||
48 | .Fn ASIdOrRange_new void | ||
49 | .Ft void | ||
50 | .Fn ASIdOrRange_free "ASIdOrRange *aor" | ||
51 | .Ft ASIdOrRange * | ||
52 | .Fo d2i_ASIdOrRange | ||
53 | .Fa "ASIdOrRange **aor" | ||
54 | .Fa "const unsigned char **der_in" | ||
55 | .Fa "long length" | ||
56 | .Fc | ||
57 | .Ft int | ||
58 | .Fo i2d_ASIdOrRange | ||
59 | .Fa "ASIdOrRange *aor" | ||
60 | .Fa "unsigned char **der_out" | ||
61 | .Fc | ||
62 | .Sh DESCRIPTION | ||
63 | .Vt ASRange | ||
64 | and | ||
65 | .Vt ASIdOrRange | ||
66 | are building blocks of the RFC 3779 | ||
67 | .Vt ASIdentifiers | ||
68 | type representing the autonomous system identifier delegation extension. | ||
69 | See | ||
70 | .Xr ASIdentifiers_new 3 | ||
71 | and | ||
72 | .Xr X509v3_asid_add_id_or_range 3 | ||
73 | for more details. | ||
74 | .Pp | ||
75 | All | ||
76 | .Vt ASN1_INTEGER Ns s | ||
77 | in this manual should be representable as unsigned 32-bit integers. | ||
78 | The library provides no convenient way of setting the value of an | ||
79 | .Vt ASN1_INTEGER | ||
80 | directly. | ||
81 | A detour via a | ||
82 | .Vt BIGNUM | ||
83 | or a string is unavoidable. | ||
84 | .Pp | ||
85 | The | ||
86 | .Vt ASRange | ||
87 | type defined in RFC 3779 section 3.2.3.8 is implemented as | ||
88 | .Bd -literal -offset indent | ||
89 | typedef struct ASRange_st { | ||
90 | ASN1_INTEGER *min; | ||
91 | ASN1_INTEGER *max; | ||
92 | } ASRange; | ||
93 | .Ed | ||
94 | .Pp | ||
95 | It represents the closed range [min,max] of AS identifiers between | ||
96 | .Fa min | ||
97 | and | ||
98 | .Fa max , | ||
99 | where | ||
100 | .Fa min | ||
101 | should be strictly smaller than | ||
102 | .Fa max . | ||
103 | .Pp | ||
104 | .Fn ASRange_new | ||
105 | allocates a new | ||
106 | .Vt ASRange | ||
107 | object with allocated, empty | ||
108 | .Fa min | ||
109 | and | ||
110 | .Fa max , | ||
111 | thus representing the invalid range [0,0]. | ||
112 | .Pp | ||
113 | .Fn ASRange_free | ||
114 | frees | ||
115 | .Fa asrange | ||
116 | including any data contained in it. | ||
117 | If | ||
118 | .Fa asrange | ||
119 | is | ||
120 | .Dv NULL , | ||
121 | no action occurs. | ||
122 | .Pp | ||
123 | The | ||
124 | .Vt ASIdOrRange | ||
125 | type defined in RFC 3779 section 3.2.3.5 is implemented as | ||
126 | .Bd -literal -offset indent | ||
127 | typedef struct ASIdOrRange_st { | ||
128 | int type; | ||
129 | union { | ||
130 | ASN1_INTEGER *id; | ||
131 | ASRange *range; | ||
132 | } u; | ||
133 | } ASIdOrRange; | ||
134 | .Ed | ||
135 | .Pp | ||
136 | representing an individual AS identifier or a range. | ||
137 | When populating an | ||
138 | .Vt ASIdOrRange | ||
139 | object by hand, its | ||
140 | .Fa type | ||
141 | should be set to | ||
142 | .Dv ASIdOrRange_id | ||
143 | or | ||
144 | .Dv ASIdOrRange_range | ||
145 | to indicate which member of the union | ||
146 | .Fa u | ||
147 | is valid. | ||
148 | .Pp | ||
149 | .Fn ASIdOrRange_new | ||
150 | returns a new | ||
151 | .Vt ASIdOrRange | ||
152 | object with invalid type and | ||
153 | .Dv NULL | ||
154 | members of the union | ||
155 | .Fa u . | ||
156 | .Pp | ||
157 | .Fn ASIdOrRange_free | ||
158 | frees | ||
159 | .Fa aor | ||
160 | including any data contained in it, | ||
161 | provided | ||
162 | .Fa type | ||
163 | is set correctly. | ||
164 | If | ||
165 | .Fa asrange | ||
166 | is | ||
167 | .Dv NULL , | ||
168 | no action occurs. | ||
169 | .Pp | ||
170 | .Fn d2i_ASRange , | ||
171 | .Fn i2d_ASRange , | ||
172 | .Fn d2i_ASIdOrRange , | ||
173 | and | ||
174 | .Fn i2d_ASIdOrRange | ||
175 | decode and encode ASN.1 | ||
176 | .Vt ASRange | ||
177 | and | ||
178 | .Vt ASIdOrRange | ||
179 | objects. | ||
180 | For details about the semantics, examples, caveats, and bugs, see | ||
181 | .Xr ASN1_item_d2i 3 . | ||
182 | In order for the encoding produced by | ||
183 | .Fn i2d_ASRange | ||
184 | to be correct, | ||
185 | .Fa min | ||
186 | must be strictly less than | ||
187 | .Fa max . | ||
188 | Similarly for | ||
189 | .Fn i2d_ASIdOrRange | ||
190 | and an | ||
191 | .Fa ASIdOrRange | ||
192 | object of | ||
193 | .Fa type | ||
194 | .Dv ASIdOrRange_range . | ||
195 | .Sh RETURN VALUES | ||
196 | .Fn ASRange_new | ||
197 | returns a new | ||
198 | .Vt ASRange | ||
199 | object or | ||
200 | .Dv NULL | ||
201 | if an error occurs. | ||
202 | .Pp | ||
203 | .Fn ASIdOrRange_new | ||
204 | returns a new, empty | ||
205 | .Vt ASIdOrRange | ||
206 | object or | ||
207 | .Dv NULL | ||
208 | if an error occurs. | ||
209 | .Pp | ||
210 | The encoding functions | ||
211 | .Fn d2i_ASRange | ||
212 | and | ||
213 | .Fn d2i_ASIdOrRange | ||
214 | return an | ||
215 | .Vt ASRange | ||
216 | or an | ||
217 | .Vt ASIdOrRange | ||
218 | object, respectively, | ||
219 | or | ||
220 | .Dv NULL | ||
221 | if an error occurs. | ||
222 | .Pp | ||
223 | The encoding functions | ||
224 | .Fn i2d_ASRange | ||
225 | and | ||
226 | .Fn i2d_ASIdOrRange | ||
227 | return the number of bytes successfully encoded | ||
228 | or a value <= 0 if an error occurs. | ||
229 | .Sh SEE ALSO | ||
230 | .Xr ASIdentifiers_new 3 , | ||
231 | .Xr BN_set_word 3 , | ||
232 | .Xr BN_to_ASN1_INTEGER 3 , | ||
233 | .Xr crypto 3 , | ||
234 | .Xr s2i_ASN1_INTEGER 3 , | ||
235 | .Xr X509_new 3 , | ||
236 | .Xr X509v3_asid_add_id_or_range 3 , | ||
237 | .Xr X509v3_asid_is_canonical 3 | ||
238 | .Sh STANDARDS | ||
239 | RFC 3779: X.509 Extensions for IP Addresses and AS Identifiers: | ||
240 | .Bl -dash -compact | ||
241 | .It | ||
242 | section 3.2.3: Syntax | ||
243 | .It | ||
244 | section 3.2.3.5: Type ASIdOrRange | ||
245 | .It | ||
246 | section 3.2.3.6: Element id | ||
247 | .It | ||
248 | section 3.2.3.7: Element range | ||
249 | .It | ||
250 | section 3.2.3.8: Type ASRange | ||
251 | .It | ||
252 | section 3.2.3.9: Elements min and max | ||
253 | .El | ||
254 | .Sh HISTORY | ||
255 | These functions first appeared in OpenSSL 0.9.8e | ||
256 | and have been available since | ||
257 | .Ox 7.1 . | ||
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile index ccf0be63fe..2ccc06895f 100644 --- a/src/lib/libcrypto/man/Makefile +++ b/src/lib/libcrypto/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.269 2023/09/25 01:14:34 tb Exp $ | 1 | # $OpenBSD: Makefile,v 1.270 2023/09/25 11:59:10 tb Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -6,6 +6,7 @@ MAN= \ | |||
6 | ACCESS_DESCRIPTION_new.3 \ | 6 | ACCESS_DESCRIPTION_new.3 \ |
7 | AES_encrypt.3 \ | 7 | AES_encrypt.3 \ |
8 | ASIdentifiers_new.3 \ | 8 | ASIdentifiers_new.3 \ |
9 | ASRange_new.3 \ | ||
9 | ASN1_BIT_STRING_set.3 \ | 10 | ASN1_BIT_STRING_set.3 \ |
10 | ASN1_INTEGER_get.3 \ | 11 | ASN1_INTEGER_get.3 \ |
11 | ASN1_NULL_new.3 \ | 12 | ASN1_NULL_new.3 \ |
diff --git a/src/lib/libcrypto/man/X509_new.3 b/src/lib/libcrypto/man/X509_new.3 index f2615cd5bd..42a29a0183 100644 --- a/src/lib/libcrypto/man/X509_new.3 +++ b/src/lib/libcrypto/man/X509_new.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: X509_new.3,v 1.38 2023/09/25 01:14:34 tb Exp $ | 1 | .\" $OpenBSD: X509_new.3,v 1.39 2023/09/25 11:59:10 tb Exp $ |
2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 | 2 | .\" full merge up to: OpenSSL 99d63d46 Oct 26 13:56:48 2016 -0400 |
3 | .\" | 3 | .\" |
4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
@@ -194,6 +194,7 @@ or | |||
194 | if an error occurs. | 194 | if an error occurs. |
195 | .Sh SEE ALSO | 195 | .Sh SEE ALSO |
196 | .Xr ASIdentifiers_new 3 , | 196 | .Xr ASIdentifiers_new 3 , |
197 | .Xr ASRange_new 3 , | ||
197 | .Xr AUTHORITY_KEYID_new 3 , | 198 | .Xr AUTHORITY_KEYID_new 3 , |
198 | .Xr BASIC_CONSTRAINTS_new 3 , | 199 | .Xr BASIC_CONSTRAINTS_new 3 , |
199 | .Xr crypto 3 , | 200 | .Xr crypto 3 , |