diff options
author | schwarze <> | 2017-01-04 05:14:51 +0000 |
---|---|---|
committer | schwarze <> | 2017-01-04 05:14:51 +0000 |
commit | a98a132e1b5f37c52906129d09c4a9853321a1c4 (patch) | |
tree | 8e331ada8bb4ae35121a26f3453e9f02e803b3ff /src/lib/libcrypto/man/OBJ_nid2obj.3 | |
parent | 38354d6effee546e2cc9f9a651d007c0611a0ae0 (diff) | |
download | openbsd-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.3 | 62 |
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 | |||
225 | If the two are identical, 0 is returned. | 242 | If the two are identical, 0 is returned. |
226 | .Pp | 243 | .Pp |
227 | .Fn OBJ_dup | 244 | .Fn OBJ_dup |
228 | returns a copy of | 245 | returns a deep copy of |
229 | .Fa o . | 246 | .Fa o |
247 | if | ||
248 | .Fa o | ||
249 | is marked as dynamically allocated. | ||
250 | The new object and all data contained in it is marked as dynamically | ||
251 | allocated. | ||
252 | If | ||
253 | .Fa o | ||
254 | is not marked as dynamically allocated, | ||
255 | .Fn OBJ_dup | ||
256 | just returns | ||
257 | .Fa o | ||
258 | itself. | ||
230 | .Pp | 259 | .Pp |
231 | .Fn OBJ_create | 260 | .Fn OBJ_create |
232 | adds a new object to the internal table. | 261 | adds a new object to the internal table. |
@@ -238,6 +267,14 @@ the short name and | |||
238 | the long name. | 267 | the long name. |
239 | A new NID is returned for the created object. | 268 | A new NID is returned for the created object. |
240 | .Pp | 269 | .Pp |
270 | The new object added to the internal table and all the data | ||
271 | contained in it is marked as not dynamically allocated. | ||
272 | Consequently, retrieving it with | ||
273 | .Fn OBJ_nid2obj | ||
274 | or a similar function and then calling | ||
275 | .Xr ASN1_OBJECT_free 3 | ||
276 | on the returned pointer will have no effect. | ||
277 | .Pp | ||
241 | .Fn OBJ_cleanup | 278 | .Fn OBJ_cleanup |
242 | cleans up the internal object table: this should be called before | 279 | cleans up the internal object table: this should be called before |
243 | an application exits if any new objects were added using | 280 | an application exits if any new objects were added using |
@@ -275,11 +312,13 @@ and | |||
275 | can process the numerical form of an OID. | 312 | can process the numerical form of an OID. |
276 | .Sh RETURN VALUES | 313 | .Sh RETURN VALUES |
277 | .Fn OBJ_nid2obj | 314 | .Fn OBJ_nid2obj |
278 | returns an | 315 | and |
316 | .Fn OBJ_dup | ||
317 | return an | ||
279 | .Vt ASN1_OBJECT | 318 | .Vt ASN1_OBJECT |
280 | structure or | 319 | object or |
281 | .Dv NULL | 320 | .Dv NULL |
282 | if an error occurred. | 321 | if an error occurs. |
283 | .Pp | 322 | .Pp |
284 | .Fn OBJ_nid2ln | 323 | .Fn OBJ_nid2ln |
285 | and | 324 | and |
@@ -296,6 +335,11 @@ and | |||
296 | return a NID or | 335 | return a NID or |
297 | .Dv NID_undef | 336 | .Dv NID_undef |
298 | on error. | 337 | on error. |
338 | .Pp | ||
339 | .Fn OBJ_create | ||
340 | returns the new NID or | ||
341 | .Dv NID_undef | ||
342 | if an error occurs. | ||
299 | .Sh EXAMPLES | 343 | .Sh EXAMPLES |
300 | Create an object for | 344 | Create an object for |
301 | .Sy commonName : | 345 | .Sy commonName : |