summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-07-05 17:57:16 +0000
committerschwarze <>2021-07-05 17:57:16 +0000
commit989ff61c1a16a5db7053119ab823c7a1cb4191e7 (patch)
tree5f9376251ab951b76585e47f2b94d8049d6b4921
parent21352cf571cfd9ae476ee15f2bf09324c89ee0e3 (diff)
downloadopenbsd-989ff61c1a16a5db7053119ab823c7a1cb4191e7.tar.gz
openbsd-989ff61c1a16a5db7053119ab823c7a1cb4191e7.tar.bz2
openbsd-989ff61c1a16a5db7053119ab823c7a1cb4191e7.zip
document i2a_ASN1_OBJECT(3)
-rw-r--r--src/lib/libcrypto/man/OBJ_nid2obj.369
1 files changed, 61 insertions, 8 deletions
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3
index 26acea5c58..db9cd05c26 100644
--- a/src/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/src/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,10 +1,10 @@
1.\" $OpenBSD: OBJ_nid2obj.3,v 1.14 2019/06/14 13:59:32 schwarze Exp $ 1.\" $OpenBSD: OBJ_nid2obj.3,v 1.15 2021/07/05 17:57:16 schwarze Exp $
2.\" OpenSSL c264592d May 14 11:28:00 2006 +0000 2.\" OpenSSL c264592d May 14 11:28:00 2006 +0000
3.\" 3.\"
4.\" This file is a derived work. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license: 5.\" The changes are covered by the following Copyright and license:
6.\" 6.\"
7.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> 7.\" Copyright (c) 2017, 2021 Ingo Schwarze <schwarze@openbsd.org>
8.\" 8.\"
9.\" Permission to use, copy, modify, and distribute this software for any 9.\" Permission to use, copy, modify, and distribute this software for any
10.\" purpose with or without fee is hereby granted, provided that the above 10.\" purpose with or without fee is hereby granted, provided that the above
@@ -66,7 +66,7 @@
66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 66.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
67.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
68.\" 68.\"
69.Dd $Mdocdate: June 14 2019 $ 69.Dd $Mdocdate: July 5 2021 $
70.Dt OBJ_NID2OBJ 3 70.Dt OBJ_NID2OBJ 3
71.Os 71.Os
72.Sh NAME 72.Sh NAME
@@ -83,7 +83,8 @@
83.Nm OBJ_dup , 83.Nm OBJ_dup ,
84.Nm OBJ_create , 84.Nm OBJ_create ,
85.Nm OBJ_cleanup , 85.Nm OBJ_cleanup ,
86.Nm i2t_ASN1_OBJECT 86.Nm i2t_ASN1_OBJECT ,
87.Nm i2a_ASN1_OBJECT
87.Nd inspect and create ASN.1 object identifiers 88.Nd inspect and create ASN.1 object identifiers
88.Sh SYNOPSIS 89.Sh SYNOPSIS
89.In openssl/objects.h 90.In openssl/objects.h
@@ -151,6 +152,11 @@
151.Fa "int buf_len" 152.Fa "int buf_len"
152.Fa "const ASN1_OBJECT *a" 153.Fa "const ASN1_OBJECT *a"
153.Fc 154.Fc
155.Ft int
156.Fo i2a_ASN1_OBJECT
157.Fa "BIO *out_bio"
158.Fa "const ASN1_OBJECT *a"
159.Fc
154.Sh DESCRIPTION 160.Sh DESCRIPTION
155The ASN.1 object utility functions process 161The ASN.1 object utility functions process
156.Vt ASN1_OBJECT 162.Vt ASN1_OBJECT
@@ -234,6 +240,29 @@ with
234.Fa no_name 240.Fa no_name
235set to 0. 241set to 0.
236.Pp 242.Pp
243.Fn i2a_ASN1_OBJECT
244writes a textual representation of
245.Fa a
246to
247.Fa out_bio
248using
249.Xr BIO_write 3 .
250It does not write a terminating NUL byte.
251If
252.Fa a
253is
254.Dv NULL
255or contains no data, it writes the 4-byte string
256.Qq NULL .
257If
258.Fn i2t_ASN1_OBJECT
259fails,
260.Fn i2a_ASN1_OBJECT
261writes the 9-byte string
262.Qq <INVALID> .
263Otherwise, it writes the string constructed with
264.Fn i2t_ASN1_OBJECT .
265.Pp
237.Fn OBJ_cmp 266.Fn OBJ_cmp
238compares 267compares
239.Fa a 268.Fa a
@@ -311,7 +340,8 @@ and
311.Fn OBJ_obj2txt 340.Fn OBJ_obj2txt
312can process the numerical form of an OID. 341can process the numerical form of an OID.
313.Sh RETURN VALUES 342.Sh RETURN VALUES
314.Fn OBJ_nid2obj 343.Fn OBJ_nid2obj ,
344.Fn OBJ_txt2obj ,
315and 345and
316.Fn OBJ_dup 346.Fn OBJ_dup
317return an 347return an
@@ -336,6 +366,25 @@ return a NID or
336.Dv NID_undef 366.Dv NID_undef
337on error. 367on error.
338.Pp 368.Pp
369.Fn OBJ_obj2txt
370and
371.Fn i2t_ASN1_OBJECT
372return the amount of space required in bytes,
373including the terminating NUL byte.
374.Pp
375.Fn i2a_ASN1_OBJECT
376returns the number of bytes written, even if
377.Fa a
378is invalid or contains invalid data,
379but a negative value if memory allocation or a write operation fails.
380.Pp
381.Fn OBJ_cmp
382returns 0 if the contents of
383.Fa a
384and
385.Fa b
386are identical, or non-zero otherwise.
387.Pp
339.Fn OBJ_create 388.Fn OBJ_create
340returns the new NID or 389returns the new NID or
341.Dv NID_undef 390.Dv NID_undef
@@ -350,8 +399,9 @@ In some cases of failure of
350.Fn OBJ_obj2txt , 399.Fn OBJ_obj2txt ,
351.Fn OBJ_dup , 400.Fn OBJ_dup ,
352.Fn OBJ_create , 401.Fn OBJ_create ,
353and
354.Fn i2t_ASN1_OBJECT , 402.Fn i2t_ASN1_OBJECT ,
403and
404.Fn i2a_ASN1_OBJECT ,
355the reason can be determined with 405the reason can be determined with
356.Xr ERR_get_error 3 . 406.Xr ERR_get_error 3 .
357.Sh EXAMPLES 407.Sh EXAMPLES
@@ -383,6 +433,7 @@ obj = OBJ_txt2obj("1.2.3.4", 1);
383.Ed 433.Ed
384.Sh SEE ALSO 434.Sh SEE ALSO
385.Xr ASN1_OBJECT_new 3 , 435.Xr ASN1_OBJECT_new 3 ,
436.Xr BIO_new 3 ,
386.Xr d2i_ASN1_OBJECT 3 437.Xr d2i_ASN1_OBJECT 3
387.Sh HISTORY 438.Sh HISTORY
388.Fn OBJ_nid2obj , 439.Fn OBJ_nid2obj ,
@@ -396,12 +447,14 @@ obj = OBJ_txt2obj("1.2.3.4", 1);
396and 447and
397.Fn OBJ_dup 448.Fn OBJ_dup
398first appeared in SSLeay 0.5.1. 449first appeared in SSLeay 0.5.1.
450.Fn i2a_ASN1_OBJECT
451first appeared in SSLeay 0.6.0,
399.Fn OBJ_cleanup 452.Fn OBJ_cleanup
400first appeared in SSLeay 0.8.0. 453in SSLeay 0.8.0, and
401.Fn OBJ_create 454.Fn OBJ_create
402and 455and
403.Fn i2t_ASN1_OBJECT 456.Fn i2t_ASN1_OBJECT
404first appeared in SSLeay 0.9.0. 457in SSLeay 0.9.0.
405All these functions have been available since 458All these functions have been available since
406.Ox 2.4 . 459.Ox 2.4 .
407.Pp 460.Pp