diff options
Diffstat (limited to 'src/lib/libcrypto/man/X509v3_get_ext_by_NID.3')
-rw-r--r-- | src/lib/libcrypto/man/X509v3_get_ext_by_NID.3 | 408 |
1 files changed, 0 insertions, 408 deletions
diff --git a/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3 b/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3 deleted file mode 100644 index 8c7c159f80..0000000000 --- a/src/lib/libcrypto/man/X509v3_get_ext_by_NID.3 +++ /dev/null | |||
@@ -1,408 +0,0 @@ | |||
1 | .\" $OpenBSD: X509v3_get_ext_by_NID.3,v 1.15 2024/05/22 09:44:10 tb Exp $ | ||
2 | .\" full merge up to: OpenSSL fd38836b Jun 20 15:25:43 2018 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
5 | .\" Copyright (c) 2015 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: May 22 2024 $ | ||
52 | .Dt X509V3_GET_EXT_BY_NID 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm X509v3_get_ext_count , | ||
56 | .Nm X509v3_get_ext , | ||
57 | .Nm X509v3_get_ext_by_NID , | ||
58 | .Nm X509v3_get_ext_by_OBJ , | ||
59 | .Nm X509v3_get_ext_by_critical , | ||
60 | .Nm X509v3_delete_ext , | ||
61 | .Nm X509v3_add_ext , | ||
62 | .Nm X509_get_ext_count , | ||
63 | .Nm X509_get_ext , | ||
64 | .Nm X509_get_ext_by_NID , | ||
65 | .Nm X509_get_ext_by_OBJ , | ||
66 | .Nm X509_get_ext_by_critical , | ||
67 | .Nm X509_delete_ext , | ||
68 | .Nm X509_add_ext , | ||
69 | .Nm X509_CRL_get_ext_count , | ||
70 | .Nm X509_CRL_get_ext , | ||
71 | .Nm X509_CRL_get_ext_by_NID , | ||
72 | .Nm X509_CRL_get_ext_by_OBJ , | ||
73 | .Nm X509_CRL_get_ext_by_critical , | ||
74 | .Nm X509_CRL_delete_ext , | ||
75 | .Nm X509_CRL_add_ext , | ||
76 | .Nm X509_REVOKED_get_ext_count , | ||
77 | .Nm X509_REVOKED_get_ext , | ||
78 | .Nm X509_REVOKED_get_ext_by_NID , | ||
79 | .Nm X509_REVOKED_get_ext_by_OBJ , | ||
80 | .Nm X509_REVOKED_get_ext_by_critical , | ||
81 | .Nm X509_REVOKED_delete_ext , | ||
82 | .Nm X509_REVOKED_add_ext | ||
83 | .Nd extension stack utility functions | ||
84 | .Sh SYNOPSIS | ||
85 | .In openssl/x509.h | ||
86 | .Ft int | ||
87 | .Fo X509v3_get_ext_count | ||
88 | .Fa "const STACK_OF(X509_EXTENSION) *x" | ||
89 | .Fc | ||
90 | .Ft X509_EXTENSION * | ||
91 | .Fo X509v3_get_ext | ||
92 | .Fa "const STACK_OF(X509_EXTENSION) *x" | ||
93 | .Fa "int loc" | ||
94 | .Fc | ||
95 | .Ft int | ||
96 | .Fo X509v3_get_ext_by_NID | ||
97 | .Fa "const STACK_OF(X509_EXTENSION) *x" | ||
98 | .Fa "int nid" | ||
99 | .Fa "int lastpos" | ||
100 | .Fc | ||
101 | .Ft int | ||
102 | .Fo X509v3_get_ext_by_OBJ | ||
103 | .Fa "const STACK_OF(X509_EXTENSION) *x" | ||
104 | .Fa "const ASN1_OBJECT *obj" | ||
105 | .Fa "int lastpos" | ||
106 | .Fc | ||
107 | .Ft int | ||
108 | .Fo X509v3_get_ext_by_critical | ||
109 | .Fa "const STACK_OF(X509_EXTENSION) *x" | ||
110 | .Fa "int crit" | ||
111 | .Fa "int lastpos" | ||
112 | .Fc | ||
113 | .Ft X509_EXTENSION * | ||
114 | .Fo X509v3_delete_ext | ||
115 | .Fa "STACK_OF(X509_EXTENSION) *x" | ||
116 | .Fa "int loc" | ||
117 | .Fc | ||
118 | .Ft STACK_OF(X509_EXTENSION) * | ||
119 | .Fo X509v3_add_ext | ||
120 | .Fa "STACK_OF(X509_EXTENSION) **x" | ||
121 | .Fa "X509_EXTENSION *ex" | ||
122 | .Fa "int loc" | ||
123 | .Fc | ||
124 | .Ft int | ||
125 | .Fo X509_get_ext_count | ||
126 | .Fa "const X509 *x" | ||
127 | .Fc | ||
128 | .Ft X509_EXTENSION * | ||
129 | .Fo X509_get_ext | ||
130 | .Fa "const X509 *x" | ||
131 | .Fa "int loc" | ||
132 | .Fc | ||
133 | .Ft int | ||
134 | .Fo X509_get_ext_by_NID | ||
135 | .Fa "const X509 *x" | ||
136 | .Fa "int nid" | ||
137 | .Fa "int lastpos" | ||
138 | .Fc | ||
139 | .Ft int | ||
140 | .Fo X509_get_ext_by_OBJ | ||
141 | .Fa "const X509 *x" | ||
142 | .Fa "const ASN1_OBJECT *obj" | ||
143 | .Fa "int lastpos" | ||
144 | .Fc | ||
145 | .Ft int | ||
146 | .Fo X509_get_ext_by_critical | ||
147 | .Fa "const X509 *x" | ||
148 | .Fa "int crit" | ||
149 | .Fa "int lastpos" | ||
150 | .Fc | ||
151 | .Ft X509_EXTENSION * | ||
152 | .Fo X509_delete_ext | ||
153 | .Fa "X509 *x" | ||
154 | .Fa "int loc" | ||
155 | .Fc | ||
156 | .Ft int | ||
157 | .Fo X509_add_ext | ||
158 | .Fa "X509 *x" | ||
159 | .Fa "X509_EXTENSION *ex" | ||
160 | .Fa "int loc" | ||
161 | .Fc | ||
162 | .Ft int | ||
163 | .Fo X509_CRL_get_ext_count | ||
164 | .Fa "const X509_CRL *x" | ||
165 | .Fc | ||
166 | .Ft X509_EXTENSION * | ||
167 | .Fo X509_CRL_get_ext | ||
168 | .Fa "const X509_CRL *x" | ||
169 | .Fa "int loc" | ||
170 | .Fc | ||
171 | .Ft int | ||
172 | .Fo X509_CRL_get_ext_by_NID | ||
173 | .Fa "const X509_CRL *x" | ||
174 | .Fa "int nid" | ||
175 | .Fa "int lastpos" | ||
176 | .Fc | ||
177 | .Ft int | ||
178 | .Fo X509_CRL_get_ext_by_OBJ | ||
179 | .Fa "const X509_CRL *x" | ||
180 | .Fa "const ASN1_OBJECT *obj" | ||
181 | .Fa "int lastpos" | ||
182 | .Fc | ||
183 | .Ft int | ||
184 | .Fo X509_CRL_get_ext_by_critical | ||
185 | .Fa "const X509_CRL *x" | ||
186 | .Fa "int crit" | ||
187 | .Fa "int lastpos" | ||
188 | .Fc | ||
189 | .Ft X509_EXTENSION * | ||
190 | .Fo X509_CRL_delete_ext | ||
191 | .Fa "X509_CRL *x" | ||
192 | .Fa "int loc" | ||
193 | .Fc | ||
194 | .Ft int | ||
195 | .Fo X509_CRL_add_ext | ||
196 | .Fa "X509_CRL *x" | ||
197 | .Fa "X509_EXTENSION *ex" | ||
198 | .Fa "int loc" | ||
199 | .Fc | ||
200 | .Ft int | ||
201 | .Fo X509_REVOKED_get_ext_count | ||
202 | .Fa "const X509_REVOKED *x" | ||
203 | .Fc | ||
204 | .Ft X509_EXTENSION * | ||
205 | .Fo X509_REVOKED_get_ext | ||
206 | .Fa "const X509_REVOKED *x" | ||
207 | .Fa "int loc" | ||
208 | .Fc | ||
209 | .Ft int | ||
210 | .Fo X509_REVOKED_get_ext_by_NID | ||
211 | .Fa "const X509_REVOKED *x" | ||
212 | .Fa "int nid" | ||
213 | .Fa "int lastpos" | ||
214 | .Fc | ||
215 | .Ft int | ||
216 | .Fo X509_REVOKED_get_ext_by_OBJ | ||
217 | .Fa "const X509_REVOKED *x" | ||
218 | .Fa "const ASN1_OBJECT *obj" | ||
219 | .Fa "int lastpos" | ||
220 | .Fc | ||
221 | .Ft int | ||
222 | .Fo X509_REVOKED_get_ext_by_critical | ||
223 | .Fa "const X509_REVOKED *x" | ||
224 | .Fa "int crit" | ||
225 | .Fa "int lastpos" | ||
226 | .Fc | ||
227 | .Ft X509_EXTENSION * | ||
228 | .Fo X509_REVOKED_delete_ext | ||
229 | .Fa "X509_REVOKED *x" | ||
230 | .Fa "int loc" | ||
231 | .Fc | ||
232 | .Ft int | ||
233 | .Fo X509_REVOKED_add_ext | ||
234 | .Fa "X509_REVOKED *x" | ||
235 | .Fa "X509_EXTENSION *ex" | ||
236 | .Fa "int loc" | ||
237 | .Fc | ||
238 | .Sh DESCRIPTION | ||
239 | .Fn X509v3_get_ext_count | ||
240 | retrieves the number of extensions in | ||
241 | .Fa x . | ||
242 | .Pp | ||
243 | .Fn X509v3_get_ext | ||
244 | retrieves extension | ||
245 | .Fa loc | ||
246 | from | ||
247 | .Fa x . | ||
248 | The index | ||
249 | .Fa loc | ||
250 | can take any value from 0 to | ||
251 | .Fn X509_get_ext_count x No \- 1 . | ||
252 | The returned extension is an internal pointer which must not be | ||
253 | freed up by the application. | ||
254 | .Pp | ||
255 | .Fn X509v3_get_ext_by_NID | ||
256 | and | ||
257 | .Fn X509v3_get_ext_by_OBJ | ||
258 | look for an extension with | ||
259 | .Fa nid | ||
260 | or | ||
261 | .Fa obj | ||
262 | from extension stack | ||
263 | .Fa x . | ||
264 | The search starts from the extension after | ||
265 | .Fa lastpos | ||
266 | or from the beginning if | ||
267 | .Fa lastpos | ||
268 | is \-1. | ||
269 | If the extension is found, its index is returned; otherwise, a negative | ||
270 | value is returned. | ||
271 | .Pp | ||
272 | .Fn X509v3_get_ext_by_critical | ||
273 | is similar to | ||
274 | .Fn X509v3_get_ext_by_NID | ||
275 | except that it looks for an extension of criticality | ||
276 | .Fa crit . | ||
277 | A zero value for | ||
278 | .Fa crit | ||
279 | looks for a non-critical extension; a non-zero value looks for a | ||
280 | critical extension. | ||
281 | .Pp | ||
282 | .Fn X509v3_delete_ext | ||
283 | deletes the extension with index | ||
284 | .Fa loc | ||
285 | from | ||
286 | .Fa x . | ||
287 | The deleted extension is returned and must be freed by the caller. | ||
288 | If | ||
289 | .Fa loc | ||
290 | is an invalid index value, | ||
291 | .Dv NULL | ||
292 | is returned. | ||
293 | .Pp | ||
294 | .Fn X509v3_add_ext | ||
295 | adds the extension | ||
296 | .Fa ex | ||
297 | to the stack | ||
298 | .Pf * Fa x | ||
299 | at position | ||
300 | .Fa loc . | ||
301 | If | ||
302 | .Fa loc | ||
303 | is \-1, the new extension is added to the end. | ||
304 | If | ||
305 | .Pf * Fa x | ||
306 | is | ||
307 | .Dv NULL , | ||
308 | a new stack will be allocated. | ||
309 | The passed extension | ||
310 | .Fa ex | ||
311 | is duplicated internally so it must be freed after use. | ||
312 | .Pp | ||
313 | .Fn X509_get_ext_count , | ||
314 | .Fn X509_get_ext , | ||
315 | .Fn X509_get_ext_by_NID , | ||
316 | .Fn X509_get_ext_by_OBJ , | ||
317 | .Fn X509_get_ext_by_critical , | ||
318 | .Fn X509_delete_ext , | ||
319 | and | ||
320 | .Fn X509_add_ext | ||
321 | operate on the extensions of certificate | ||
322 | .Fa x . | ||
323 | They are otherwise identical to the X509v3 functions. | ||
324 | .Pp | ||
325 | .Fn X509_CRL_get_ext_count , | ||
326 | .Fn X509_CRL_get_ext , | ||
327 | .Fn X509_CRL_get_ext_by_NID , | ||
328 | .Fn X509_CRL_get_ext_by_OBJ , | ||
329 | .Fn X509_CRL_get_ext_by_critical , | ||
330 | .Fn X509_CRL_delete_ext , | ||
331 | and | ||
332 | .Fn X509_CRL_add_ext | ||
333 | operate on the extensions of the CRL | ||
334 | .Fa x . | ||
335 | They are otherwise identical to the X509v3 functions. | ||
336 | .Pp | ||
337 | .Fn X509_REVOKED_get_ext_count , | ||
338 | .Fn X509_REVOKED_get_ext , | ||
339 | .Fn X509_REVOKED_get_ext_by_NID , | ||
340 | .Fn X509_REVOKED_get_ext_by_OBJ , | ||
341 | .Fn X509_REVOKED_get_ext_by_critical , | ||
342 | .Fn X509_REVOKED_delete_ext , | ||
343 | and | ||
344 | .Fn X509_REVOKED_add_ext | ||
345 | operate on the extensions of the CRL entry | ||
346 | .Fa x . | ||
347 | They are otherwise identical to the X509v3 functions. | ||
348 | .Pp | ||
349 | These functions are used to examine stacks of extensions directly. | ||
350 | Many applications will want to parse or encode and add an extension: | ||
351 | they should use the extension encode and decode functions instead | ||
352 | such as | ||
353 | .Xr X509_get_ext_d2i 3 . | ||
354 | .Pp | ||
355 | Extension indices start from zero, so a zero index return value is | ||
356 | not an error. | ||
357 | These search functions start from the extension | ||
358 | .Em after | ||
359 | the | ||
360 | .Fa lastpos | ||
361 | parameter, so it should initially be set to \-1. | ||
362 | If it is set to 0, the initial extension will not be checked. | ||
363 | .Sh RETURN VALUES | ||
364 | .Fn X509v3_get_ext_count | ||
365 | returns the extension count. | ||
366 | .Pp | ||
367 | .Fn X509v3_get_ext , | ||
368 | .Fn X509v3_delete_ext , | ||
369 | and | ||
370 | .Fn X509_delete_ext | ||
371 | return an | ||
372 | .Vt X509_EXTENSION | ||
373 | pointer or | ||
374 | .Dv NULL | ||
375 | if an error occurs. | ||
376 | .Pp | ||
377 | .Fn X509v3_get_ext_by_NID , | ||
378 | .Fn X509v3_get_ext_by_OBJ , | ||
379 | and | ||
380 | .Fn X509v3_get_ext_by_critical | ||
381 | return the extension index or \-1 if an error occurs. | ||
382 | In addition, | ||
383 | .Fn X509v3_get_ext_by_NID | ||
384 | returns \-2 if | ||
385 | .Xr OBJ_nid2obj 3 | ||
386 | fails on the requested | ||
387 | .Fa nid . | ||
388 | .Pp | ||
389 | .Fn X509v3_add_ext | ||
390 | returns a stack of extensions or | ||
391 | .Dv NULL | ||
392 | on error. | ||
393 | .Pp | ||
394 | .Fn X509_add_ext | ||
395 | returns 1 on success or 0 on error. | ||
396 | .Sh SEE ALSO | ||
397 | .Xr OBJ_nid2obj 3 , | ||
398 | .Xr X509_CRL_new 3 , | ||
399 | .Xr X509_EXTENSION_new 3 , | ||
400 | .Xr X509_new 3 , | ||
401 | .Xr X509_REVOKED_new 3 , | ||
402 | .Xr X509V3_EXT_print 3 , | ||
403 | .Xr X509V3_extensions_print 3 , | ||
404 | .Xr X509V3_get_d2i 3 | ||
405 | .Sh HISTORY | ||
406 | These functions first appeared in SSLeay 0.8.0 | ||
407 | and have been available since | ||
408 | .Ox 2.4 . | ||