diff options
| author | schwarze <> | 2023-09-06 12:26:59 +0000 |
|---|---|---|
| committer | schwarze <> | 2023-09-06 12:26:59 +0000 |
| commit | 3aa1b2e8441a0ec96b950c28bf70423acb429b35 (patch) | |
| tree | e6049729fd6634de337b8fb6b398b5626a01975a /src/lib/libc | |
| parent | 49449f8b9d96d2a3eb073162abd30c21599dbde8 (diff) | |
| download | openbsd-3aa1b2e8441a0ec96b950c28bf70423acb429b35.tar.gz openbsd-3aa1b2e8441a0ec96b950c28bf70423acb429b35.tar.bz2 openbsd-3aa1b2e8441a0ec96b950c28bf70423acb429b35.zip | |
Correct the RETURN VALUES of OBJ_add_object(3).
The text was misleading before and after the improvement
in obj_dat.c rev. 1.61. The way i'm fixing the documentation
here takes that improvement into account.
Also add a CAVEATS section about adding incomplete objects.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/OBJ_create.3 | 39 |
1 files changed, 33 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/OBJ_create.3 b/src/lib/libcrypto/man/OBJ_create.3 index 690c1c77f0..7a6135e052 100644 --- a/src/lib/libcrypto/man/OBJ_create.3 +++ b/src/lib/libcrypto/man/OBJ_create.3 | |||
| @@ -1,13 +1,13 @@ | |||
| 1 | .\" $OpenBSD: OBJ_create.3,v 1.7 2023/07/21 05:02:53 tb Exp $ | 1 | .\" $OpenBSD: OBJ_create.3,v 1.8 2023/09/06 12:26:59 schwarze Exp $ |
| 2 | .\" full merge up to: | 2 | .\" full merge up to: |
| 3 | .\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400 | 3 | .\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400 |
| 4 | .\" selective merge up to: | 4 | .\" selective merge up to: |
| 5 | .\" OpenSSL OBJ_nid2obj.pod 35fd9953 May 28 14:49:38 2019 +0200 | 5 | .\" OpenSSL OBJ_nid2obj.pod 0c5bc96f Mar 15 13:57:22 2022 +0000 |
| 6 | .\" | 6 | .\" |
| 7 | .\" This file is a derived work. | 7 | .\" This file is a derived work. |
| 8 | .\" The changes are covered by the following Copyright and license: | 8 | .\" The changes are covered by the following Copyright and license: |
| 9 | .\" | 9 | .\" |
| 10 | .\" Copyright (c) 2017, 2021 Ingo Schwarze <schwarze@openbsd.org> | 10 | .\" Copyright (c) 2017, 2021, 2023 Ingo Schwarze <schwarze@openbsd.org> |
| 11 | .\" | 11 | .\" |
| 12 | .\" Permission to use, copy, modify, and distribute this software for any | 12 | .\" Permission to use, copy, modify, and distribute this software for any |
| 13 | .\" purpose with or without fee is hereby granted, provided that the above | 13 | .\" purpose with or without fee is hereby granted, provided that the above |
| @@ -69,7 +69,7 @@ | |||
| 69 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 69 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 70 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 70 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 71 | .\" | 71 | .\" |
| 72 | .Dd $Mdocdate: July 21 2023 $ | 72 | .Dd $Mdocdate: September 6 2023 $ |
| 73 | .Dt OBJ_CREATE 3 | 73 | .Dt OBJ_CREATE 3 |
| 74 | .Os | 74 | .Os |
| 75 | .Sh NAME | 75 | .Sh NAME |
| @@ -217,11 +217,15 @@ The opposite order will usually not work. | |||
| 217 | returns the new NID. | 217 | returns the new NID. |
| 218 | .Pp | 218 | .Pp |
| 219 | .Fn OBJ_add_object | 219 | .Fn OBJ_add_object |
| 220 | returns the NID associated with the | 220 | returns the NID of the added |
| 221 | .Fa object | 221 | .Fa object |
| 222 | or | 222 | or |
| 223 | .Dv NID_undef | 223 | .Dv NID_undef |
| 224 | if memory allocation fails. | 224 | if no object was added because the |
| 225 | .Fa object | ||
| 226 | argument was | ||
| 227 | .Dv NULL , | ||
| 228 | did not contain an NID, or memory allocation failed. | ||
| 225 | .Pp | 229 | .Pp |
| 226 | .Fn OBJ_create | 230 | .Fn OBJ_create |
| 227 | returns the new NID or | 231 | returns the new NID or |
| @@ -271,6 +275,29 @@ and | |||
| 271 | .Fn check_defer | 275 | .Fn check_defer |
| 272 | first appeared in OpenSSL 1.0.0 and have been available since | 276 | first appeared in OpenSSL 1.0.0 and have been available since |
| 273 | .Ox 4.9 . | 277 | .Ox 4.9 . |
| 278 | .Sh CAVEATS | ||
| 279 | .Fn OBJ_add_object | ||
| 280 | indicates success even after adding an incomplete object that was created with | ||
| 281 | .Xr ASN1_OBJECT_create 3 | ||
| 282 | but lacks a short name, a long name, or an OID. | ||
| 283 | .Pp | ||
| 284 | Even | ||
| 285 | .Fn OBJ_create | ||
| 286 | tolerates | ||
| 287 | .Dv NULL | ||
| 288 | pointers being passed for the | ||
| 289 | .Fa sn | ||
| 290 | and/or | ||
| 291 | .Fa ln | ||
| 292 | arguments, in which case | ||
| 293 | .Xr OBJ_nid2sn 3 | ||
| 294 | and | ||
| 295 | .Xr OBJ_sn2nid 3 | ||
| 296 | or | ||
| 297 | .Xr OBJ_nid2ln 3 | ||
| 298 | and | ||
| 299 | .Xr OBJ_ln2nid 3 | ||
| 300 | will not work on the added object, respectively. | ||
| 274 | .Sh BUGS | 301 | .Sh BUGS |
| 275 | .Fn OBJ_new_nid | 302 | .Fn OBJ_new_nid |
| 276 | does not reserve any return value to indicate an error. | 303 | does not reserve any return value to indicate an error. |
