summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/OBJ_nid2obj.3
diff options
context:
space:
mode:
authorschwarze <>2017-01-04 05:14:51 +0000
committerschwarze <>2017-01-04 05:14:51 +0000
commita98a132e1b5f37c52906129d09c4a9853321a1c4 (patch)
tree8e331ada8bb4ae35121a26f3453e9f02e803b3ff /src/lib/libcrypto/man/OBJ_nid2obj.3
parent38354d6effee546e2cc9f9a651d007c0611a0ae0 (diff)
downloadopenbsd-a98a132e1b5f37c52906129d09c4a9853321a1c4.tar.gz
openbsd-a98a132e1b5f37c52906129d09c4a9853321a1c4.tar.bz2
openbsd-a98a132e1b5f37c52906129d09c4a9853321a1c4.zip
Describe what ASN1_OBJECT_new(3), ASN1_OBJECT_free(3), OBJ_dup(3),
and OBJ_create(3) really do rather than making broad and incomplete statements that are only true in some cases. Improve the one-line descriptions. Some minor wording improvements while here. There is obviously more work to do in the vicinity...
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_nid2obj.3')
-rw-r--r--src/lib/libcrypto/man/OBJ_nid2obj.362
1 files changed, 53 insertions, 9 deletions
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3
index 6183831784..5fa3e6fa7a 100644
--- a/src/lib/libcrypto/man/OBJ_nid2obj.3
+++ b/src/lib/libcrypto/man/OBJ_nid2obj.3
@@ -1,7 +1,24 @@
1.\" $OpenBSD: OBJ_nid2obj.3,v 1.4 2016/11/27 18:22:25 schwarze Exp $ 1.\" $OpenBSD: OBJ_nid2obj.3,v 1.5 2017/01/04 05:14:51 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 was written by Dr. Stephen Henson <steve@openssl.org>. 4.\" This file is a derived work.
5.\" The changes are covered by the following Copyright and license:
6.\"
7.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
8.\"
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
11.\" copyright notice and this permission notice appear in all copies.
12.\"
13.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
14.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
15.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
16.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
17.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20.\"
21.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>.
5.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project. 22.\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project.
6.\" All rights reserved. 23.\" All rights reserved.
7.\" 24.\"
@@ -49,7 +66,7 @@
49.\" 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
50.\" OF THE POSSIBILITY OF SUCH DAMAGE. 67.\" OF THE POSSIBILITY OF SUCH DAMAGE.
51.\" 68.\"
52.Dd $Mdocdate: November 27 2016 $ 69.Dd $Mdocdate: January 4 2017 $
53.Dt OBJ_NID2OBJ 3 70.Dt OBJ_NID2OBJ 3
54.Os 71.Os
55.Sh NAME 72.Sh NAME
@@ -67,7 +84,7 @@
67.Nm OBJ_create , 84.Nm OBJ_create ,
68.Nm OBJ_cleanup , 85.Nm OBJ_cleanup ,
69.Nm i2t_ASN1_OBJECT 86.Nm i2t_ASN1_OBJECT
70.Nd ASN.1 object utility functions 87.Nd inspect and create ASN.1 object identifiers
71.Sh SYNOPSIS 88.Sh SYNOPSIS
72.In openssl/objects.h 89.In openssl/objects.h
73.Ft ASN1_OBJECT * 90.Ft ASN1_OBJECT *
@@ -225,8 +242,20 @@ to
225If the two are identical, 0 is returned. 242If the two are identical, 0 is returned.
226.Pp 243.Pp
227.Fn OBJ_dup 244.Fn OBJ_dup
228returns a copy of 245returns a deep copy of
229.Fa o . 246.Fa o
247if
248.Fa o
249is marked as dynamically allocated.
250The new object and all data contained in it is marked as dynamically
251allocated.
252If
253.Fa o
254is not marked as dynamically allocated,
255.Fn OBJ_dup
256just returns
257.Fa o
258itself.
230.Pp 259.Pp
231.Fn OBJ_create 260.Fn OBJ_create
232adds a new object to the internal table. 261adds a new object to the internal table.
@@ -238,6 +267,14 @@ the short name and
238the long name. 267the long name.
239A new NID is returned for the created object. 268A new NID is returned for the created object.
240.Pp 269.Pp
270The new object added to the internal table and all the data
271contained in it is marked as not dynamically allocated.
272Consequently, retrieving it with
273.Fn OBJ_nid2obj
274or a similar function and then calling
275.Xr ASN1_OBJECT_free 3
276on the returned pointer will have no effect.
277.Pp
241.Fn OBJ_cleanup 278.Fn OBJ_cleanup
242cleans up the internal object table: this should be called before 279cleans up the internal object table: this should be called before
243an application exits if any new objects were added using 280an application exits if any new objects were added using
@@ -275,11 +312,13 @@ and
275can process the numerical form of an OID. 312can process the numerical form of an OID.
276.Sh RETURN VALUES 313.Sh RETURN VALUES
277.Fn OBJ_nid2obj 314.Fn OBJ_nid2obj
278returns an 315and
316.Fn OBJ_dup
317return an
279.Vt ASN1_OBJECT 318.Vt ASN1_OBJECT
280structure or 319object or
281.Dv NULL 320.Dv NULL
282if an error occurred. 321if an error occurs.
283.Pp 322.Pp
284.Fn OBJ_nid2ln 323.Fn OBJ_nid2ln
285and 324and
@@ -296,6 +335,11 @@ and
296return a NID or 335return a NID or
297.Dv NID_undef 336.Dv NID_undef
298on error. 337on error.
338.Pp
339.Fn OBJ_create
340returns the new NID or
341.Dv NID_undef
342if an error occurs.
299.Sh EXAMPLES 343.Sh EXAMPLES
300Create an object for 344Create an object for
301.Sy commonName : 345.Sy commonName :