diff options
| author | schwarze <> | 2021-12-15 20:07:51 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-12-15 20:07:51 +0000 |
| commit | 4bef3ac348ab952982f29292e386a7e59206751e (patch) | |
| tree | 347cf4cc9928f5f06b7102ef9daf11dea451fac9 /src/lib/libcrypto/man/OBJ_nid2obj.3 | |
| parent | 98fddc4bf3469b89fb967b10c9b9761444c62ad4 (diff) | |
| download | openbsd-4bef3ac348ab952982f29292e386a7e59206751e.tar.gz openbsd-4bef3ac348ab952982f29292e386a7e59206751e.tar.bz2 openbsd-4bef3ac348ab952982f29292e386a7e59206751e.zip | |
Move OBJ_create(3) into its own manual page
because OBJ_nid2obj(3) is already long and
more functions related to OBJ_create(3) have to be documented.
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_nid2obj.3')
| -rw-r--r-- | src/lib/libcrypto/man/OBJ_nid2obj.3 | 67 |
1 files changed, 9 insertions, 58 deletions
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3 index db9cd05c26..a43fe962e1 100644 --- a/src/lib/libcrypto/man/OBJ_nid2obj.3 +++ b/src/lib/libcrypto/man/OBJ_nid2obj.3 | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | .\" $OpenBSD: OBJ_nid2obj.3,v 1.15 2021/07/05 17:57:16 schwarze Exp $ | 1 | .\" $OpenBSD: OBJ_nid2obj.3,v 1.16 2021/12/15 20:07:51 schwarze Exp $ |
| 2 | .\" OpenSSL c264592d May 14 11:28:00 2006 +0000 | 2 | .\" full merge up to: OpenSSL c264592d May 14 11:28:00 2006 +0000 |
| 3 | .\" selective merge up to: OpenSSL 35fd9953 May 28 14:49:38 2019 +0200 | ||
| 3 | .\" | 4 | .\" |
| 4 | .\" This file is a derived work. | 5 | .\" This file is a derived work. |
| 5 | .\" The changes are covered by the following Copyright and license: | 6 | .\" The changes are covered by the following Copyright and license: |
| @@ -19,7 +20,7 @@ | |||
| 19 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 20 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 20 | .\" | 21 | .\" |
| 21 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | 22 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. |
| 22 | .\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project. | 23 | .\" Copyright (c) 2002, 2006, 2016 The OpenSSL Project. |
| 23 | .\" All rights reserved. | 24 | .\" All rights reserved. |
| 24 | .\" | 25 | .\" |
| 25 | .\" Redistribution and use in source and binary forms, with or without | 26 | .\" Redistribution and use in source and binary forms, with or without |
| @@ -66,7 +67,7 @@ | |||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 67 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 68 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 68 | .\" | 69 | .\" |
| 69 | .Dd $Mdocdate: July 5 2021 $ | 70 | .Dd $Mdocdate: December 15 2021 $ |
| 70 | .Dt OBJ_NID2OBJ 3 | 71 | .Dt OBJ_NID2OBJ 3 |
| 71 | .Os | 72 | .Os |
| 72 | .Sh NAME | 73 | .Sh NAME |
| @@ -81,8 +82,6 @@ | |||
| 81 | .Nm OBJ_obj2txt , | 82 | .Nm OBJ_obj2txt , |
| 82 | .Nm OBJ_cmp , | 83 | .Nm OBJ_cmp , |
| 83 | .Nm OBJ_dup , | 84 | .Nm OBJ_dup , |
| 84 | .Nm OBJ_create , | ||
| 85 | .Nm OBJ_cleanup , | ||
| 86 | .Nm i2t_ASN1_OBJECT , | 85 | .Nm i2t_ASN1_OBJECT , |
| 87 | .Nm i2a_ASN1_OBJECT | 86 | .Nm i2a_ASN1_OBJECT |
| 88 | .Nd inspect and create ASN.1 object identifiers | 87 | .Nd inspect and create ASN.1 object identifiers |
| @@ -137,14 +136,6 @@ | |||
| 137 | .Fo OBJ_dup | 136 | .Fo OBJ_dup |
| 138 | .Fa "const ASN1_OBJECT *o" | 137 | .Fa "const ASN1_OBJECT *o" |
| 139 | .Fc | 138 | .Fc |
| 140 | .Ft int | ||
| 141 | .Fo OBJ_create | ||
| 142 | .Fa "const char *oid" | ||
| 143 | .Fa "const char *sn" | ||
| 144 | .Fa "const char *ln" | ||
| 145 | .Fc | ||
| 146 | .Ft void | ||
| 147 | .Fn OBJ_cleanup void | ||
| 148 | .In openssl/asn1.h | 139 | .In openssl/asn1.h |
| 149 | .Ft int | 140 | .Ft int |
| 150 | .Fo i2t_ASN1_OBJECT | 141 | .Fo i2t_ASN1_OBJECT |
| @@ -286,29 +277,6 @@ just returns | |||
| 286 | .Fa o | 277 | .Fa o |
| 287 | itself. | 278 | itself. |
| 288 | .Pp | 279 | .Pp |
| 289 | .Fn OBJ_create | ||
| 290 | adds a new object to the internal table. | ||
| 291 | .Fa oid | ||
| 292 | is the numerical form of the object, | ||
| 293 | .Fa sn | ||
| 294 | the short name and | ||
| 295 | .Fa ln | ||
| 296 | the long name. | ||
| 297 | A new NID is returned for the created object. | ||
| 298 | .Pp | ||
| 299 | The new object added to the internal table and all the data | ||
| 300 | contained in it is marked as not dynamically allocated. | ||
| 301 | Consequently, retrieving it with | ||
| 302 | .Fn OBJ_nid2obj | ||
| 303 | or a similar function and then calling | ||
| 304 | .Xr ASN1_OBJECT_free 3 | ||
| 305 | on the returned pointer will have no effect. | ||
| 306 | .Pp | ||
| 307 | .Fn OBJ_cleanup | ||
| 308 | cleans up the internal object table: this should be called before | ||
| 309 | an application exits if any new objects were added using | ||
| 310 | .Fn OBJ_create . | ||
| 311 | .Pp | ||
| 312 | Objects can have a short name, a long name, and a numerical | 280 | Objects can have a short name, a long name, and a numerical |
| 313 | identifier (NID) associated with them. | 281 | identifier (NID) associated with them. |
| 314 | A standard set of objects is represented in an internal table. | 282 | A standard set of objects is represented in an internal table. |
| @@ -323,7 +291,7 @@ For example, the OID for commonName has the following definitions: | |||
| 323 | .Ed | 291 | .Ed |
| 324 | .Pp | 292 | .Pp |
| 325 | New objects can be added by calling | 293 | New objects can be added by calling |
| 326 | .Fn OBJ_create . | 294 | .Xr OBJ_create 3 . |
| 327 | .Pp | 295 | .Pp |
| 328 | Table objects have certain advantages over other objects: for example | 296 | Table objects have certain advantages over other objects: for example |
| 329 | their NIDs can be used in a C language switch statement. | 297 | their NIDs can be used in a C language switch statement. |
| @@ -385,11 +353,6 @@ and | |||
| 385 | .Fa b | 353 | .Fa b |
| 386 | are identical, or non-zero otherwise. | 354 | are identical, or non-zero otherwise. |
| 387 | .Pp | 355 | .Pp |
| 388 | .Fn OBJ_create | ||
| 389 | returns the new NID or | ||
| 390 | .Dv NID_undef | ||
| 391 | if an error occurs. | ||
| 392 | .Pp | ||
| 393 | In some cases of failure of | 356 | In some cases of failure of |
| 394 | .Fn OBJ_nid2obj , | 357 | .Fn OBJ_nid2obj , |
| 395 | .Fn OBJ_nid2ln , | 358 | .Fn OBJ_nid2ln , |
| @@ -398,7 +361,6 @@ In some cases of failure of | |||
| 398 | .Fn OBJ_txt2obj , | 361 | .Fn OBJ_txt2obj , |
| 399 | .Fn OBJ_obj2txt , | 362 | .Fn OBJ_obj2txt , |
| 400 | .Fn OBJ_dup , | 363 | .Fn OBJ_dup , |
| 401 | .Fn OBJ_create , | ||
| 402 | .Fn i2t_ASN1_OBJECT , | 364 | .Fn i2t_ASN1_OBJECT , |
| 403 | and | 365 | and |
| 404 | .Fn i2a_ASN1_OBJECT , | 366 | .Fn i2a_ASN1_OBJECT , |
| @@ -419,14 +381,6 @@ if (OBJ_obj2nid(obj) == NID_commonName) | |||
| 419 | /* Do something */ | 381 | /* Do something */ |
| 420 | .Ed | 382 | .Ed |
| 421 | .Pp | 383 | .Pp |
| 422 | Create a new NID and initialize an object from it: | ||
| 423 | .Bd -literal -offset indent | ||
| 424 | int new_nid; | ||
| 425 | ASN1_OBJECT *obj; | ||
| 426 | new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); | ||
| 427 | obj = OBJ_nid2obj(new_nid); | ||
| 428 | .Ed | ||
| 429 | .Pp | ||
| 430 | Create a new object directly: | 384 | Create a new object directly: |
| 431 | .Bd -literal -offset indent | 385 | .Bd -literal -offset indent |
| 432 | obj = OBJ_txt2obj("1.2.3.4", 1); | 386 | obj = OBJ_txt2obj("1.2.3.4", 1); |
| @@ -434,7 +388,8 @@ obj = OBJ_txt2obj("1.2.3.4", 1); | |||
| 434 | .Sh SEE ALSO | 388 | .Sh SEE ALSO |
| 435 | .Xr ASN1_OBJECT_new 3 , | 389 | .Xr ASN1_OBJECT_new 3 , |
| 436 | .Xr BIO_new 3 , | 390 | .Xr BIO_new 3 , |
| 437 | .Xr d2i_ASN1_OBJECT 3 | 391 | .Xr d2i_ASN1_OBJECT 3 , |
| 392 | .Xr OBJ_create 3 | ||
| 438 | .Sh HISTORY | 393 | .Sh HISTORY |
| 439 | .Fn OBJ_nid2obj , | 394 | .Fn OBJ_nid2obj , |
| 440 | .Fn OBJ_nid2ln , | 395 | .Fn OBJ_nid2ln , |
| @@ -448,11 +403,7 @@ and | |||
| 448 | .Fn OBJ_dup | 403 | .Fn OBJ_dup |
| 449 | first appeared in SSLeay 0.5.1. | 404 | first appeared in SSLeay 0.5.1. |
| 450 | .Fn i2a_ASN1_OBJECT | 405 | .Fn i2a_ASN1_OBJECT |
| 451 | first appeared in SSLeay 0.6.0, | 406 | first appeared in SSLeay 0.6.0, and |
| 452 | .Fn OBJ_cleanup | ||
| 453 | in SSLeay 0.8.0, and | ||
| 454 | .Fn OBJ_create | ||
| 455 | and | ||
| 456 | .Fn i2t_ASN1_OBJECT | 407 | .Fn i2t_ASN1_OBJECT |
| 457 | in SSLeay 0.9.0. | 408 | in SSLeay 0.9.0. |
| 458 | All these functions have been available since | 409 | All these functions have been available since |
