diff options
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_create.3')
| -rw-r--r-- | src/lib/libcrypto/man/OBJ_create.3 | 249 |
1 files changed, 0 insertions, 249 deletions
diff --git a/src/lib/libcrypto/man/OBJ_create.3 b/src/lib/libcrypto/man/OBJ_create.3 deleted file mode 100644 index fa5bde3dd3..0000000000 --- a/src/lib/libcrypto/man/OBJ_create.3 +++ /dev/null | |||
| @@ -1,249 +0,0 @@ | |||
| 1 | .\" $OpenBSD: OBJ_create.3,v 1.10 2024/01/31 08:02:53 tb Exp $ | ||
| 2 | .\" full merge up to: | ||
| 3 | .\" OpenSSL OBJ_nid2obj.pod 9b86974e Aug 17 15:21:33 2015 -0400 | ||
| 4 | .\" selective merge up to: | ||
| 5 | .\" OpenSSL OBJ_nid2obj.pod 0c5bc96f Mar 15 13:57:22 2022 +0000 | ||
| 6 | .\" | ||
| 7 | .\" This file is a derived work. | ||
| 8 | .\" The changes are covered by the following Copyright and license: | ||
| 9 | .\" | ||
| 10 | .\" Copyright (c) 2017, 2021, 2023 Ingo Schwarze <schwarze@openbsd.org> | ||
| 11 | .\" | ||
| 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 | ||
| 14 | .\" copyright notice and this permission notice appear in all copies. | ||
| 15 | .\" | ||
| 16 | .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
| 17 | .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
| 18 | .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
| 19 | .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
| 20 | .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
| 21 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
| 22 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
| 23 | .\" | ||
| 24 | .\" The original file was written by Dr. Stephen Henson <steve@openssl.org>. | ||
| 25 | .\" Copyright (c) 2002, 2006 The OpenSSL Project. | ||
| 26 | .\" All rights reserved. | ||
| 27 | .\" | ||
| 28 | .\" Redistribution and use in source and binary forms, with or without | ||
| 29 | .\" modification, are permitted provided that the following conditions | ||
| 30 | .\" are met: | ||
| 31 | .\" | ||
| 32 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 33 | .\" notice, this list of conditions and the following disclaimer. | ||
| 34 | .\" | ||
| 35 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 36 | .\" notice, this list of conditions and the following disclaimer in | ||
| 37 | .\" the documentation and/or other materials provided with the | ||
| 38 | .\" distribution. | ||
| 39 | .\" | ||
| 40 | .\" 3. All advertising materials mentioning features or use of this | ||
| 41 | .\" software must display the following acknowledgment: | ||
| 42 | .\" "This product includes software developed by the OpenSSL Project | ||
| 43 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 44 | .\" | ||
| 45 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 46 | .\" endorse or promote products derived from this software without | ||
| 47 | .\" prior written permission. For written permission, please contact | ||
| 48 | .\" openssl-core@openssl.org. | ||
| 49 | .\" | ||
| 50 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 51 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 52 | .\" permission of the OpenSSL Project. | ||
| 53 | .\" | ||
| 54 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 55 | .\" acknowledgment: | ||
| 56 | .\" "This product includes software developed by the OpenSSL Project | ||
| 57 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 58 | .\" | ||
| 59 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 60 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 61 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 62 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 63 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 64 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 65 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 66 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 67 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 68 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 69 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 70 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 71 | .\" | ||
| 72 | .Dd $Mdocdate: January 31 2024 $ | ||
| 73 | .Dt OBJ_CREATE 3 | ||
| 74 | .Os | ||
| 75 | .Sh NAME | ||
| 76 | .Nm OBJ_new_nid , | ||
| 77 | .Nm OBJ_add_object , | ||
| 78 | .Nm OBJ_create , | ||
| 79 | .\" OBJ_create_and_add_object is a deprecated, unused alias for OBJ_create(3). | ||
| 80 | .Nm OBJ_create_objects , | ||
| 81 | .Nm OBJ_cleanup | ||
| 82 | .Nd modify the table of ASN.1 object identifiers | ||
| 83 | .Sh SYNOPSIS | ||
| 84 | .In openssl/objects.h | ||
| 85 | .Ft int | ||
| 86 | .Fn OBJ_new_nid "int increment" | ||
| 87 | .Ft int | ||
| 88 | .Fn OBJ_add_object "const ASN1_OBJECT *object" | ||
| 89 | .Ft int | ||
| 90 | .Fo OBJ_create | ||
| 91 | .Fa "const char *oid" | ||
| 92 | .Fa "const char *sn" | ||
| 93 | .Fa "const char *ln" | ||
| 94 | .Fc | ||
| 95 | .Ft int | ||
| 96 | .Fn OBJ_create_objects "BIO *in_bio" | ||
| 97 | .Ft void | ||
| 98 | .Fn OBJ_cleanup void | ||
| 99 | .Sh DESCRIPTION | ||
| 100 | .Fn OBJ_new_nid | ||
| 101 | returns the smallest currently unassigned ASN.1 numeric | ||
| 102 | object identifier (NID) and reserves | ||
| 103 | .Fa increment | ||
| 104 | consecutive NIDs starting with it. | ||
| 105 | Passing an argument of 1 is usually recommended. | ||
| 106 | The return value can be assigned to a new object by passing it as the | ||
| 107 | .Fa nid | ||
| 108 | argument to | ||
| 109 | .Xr ASN1_OBJECT_create 3 | ||
| 110 | and by passing the resulting object to | ||
| 111 | .Fn OBJ_add_object . | ||
| 112 | .Pp | ||
| 113 | .Fn OBJ_add_object | ||
| 114 | adds a copy of the | ||
| 115 | .Fa object | ||
| 116 | to the internal table of ASN.1 object identifiers for use by | ||
| 117 | .Xr OBJ_nid2obj 3 | ||
| 118 | and related functions. | ||
| 119 | .Pp | ||
| 120 | .Fn OBJ_create | ||
| 121 | provides a simpler way to add a new object to the internal table. | ||
| 122 | .Fa oid | ||
| 123 | is the numerical form of the object, | ||
| 124 | .Fa sn | ||
| 125 | the short name and | ||
| 126 | .Fa ln | ||
| 127 | the long name. | ||
| 128 | A new NID is automatically assigned using | ||
| 129 | .Fn OBJ_new_nid . | ||
| 130 | .Pp | ||
| 131 | .Fn OBJ_create_objects | ||
| 132 | reads text lines of the form | ||
| 133 | .Pp | ||
| 134 | .D1 Fa oid sn ln | ||
| 135 | .Pp | ||
| 136 | from | ||
| 137 | .Fa in_bio | ||
| 138 | and calls | ||
| 139 | .Fn OBJ_create oid sn ln | ||
| 140 | for every line read. | ||
| 141 | The three fields of the input lines | ||
| 142 | are separated by one or more whitespace characters. | ||
| 143 | .Pp | ||
| 144 | For all three functions, the objects added to the internal table and | ||
| 145 | all the data contained in them is marked as not dynamically allocated. | ||
| 146 | Consequently, retrieving them with | ||
| 147 | .Xr OBJ_nid2obj 3 | ||
| 148 | or a similar function and then calling | ||
| 149 | .Xr ASN1_OBJECT_free 3 | ||
| 150 | on the returned pointer will have no effect. | ||
| 151 | .Pp | ||
| 152 | .Fn OBJ_cleanup | ||
| 153 | resets the internal object table to its default state, | ||
| 154 | removing and freeing all objects that were added with | ||
| 155 | .Fn OBJ_add_object , | ||
| 156 | .Fn OBJ_create , | ||
| 157 | or | ||
| 158 | .Fn OBJ_create_objects . | ||
| 159 | .Sh RETURN VALUES | ||
| 160 | .Fn OBJ_new_nid | ||
| 161 | returns the new NID. | ||
| 162 | .Pp | ||
| 163 | .Fn OBJ_add_object | ||
| 164 | returns the NID of the added | ||
| 165 | .Fa object | ||
| 166 | or | ||
| 167 | .Dv NID_undef | ||
| 168 | if no object was added because the | ||
| 169 | .Fa object | ||
| 170 | argument was | ||
| 171 | .Dv NULL , | ||
| 172 | did not contain an NID, or memory allocation failed. | ||
| 173 | .Pp | ||
| 174 | .Fn OBJ_create | ||
| 175 | returns the new NID or | ||
| 176 | .Dv NID_undef | ||
| 177 | if | ||
| 178 | .Fa oid | ||
| 179 | is not a valid representation of an object identifier | ||
| 180 | or if memory allocation fails. | ||
| 181 | .Pp | ||
| 182 | .Fn OBJ_create_objects | ||
| 183 | returns the number of objects added. | ||
| 184 | .Pp | ||
| 185 | In some cases of failure of | ||
| 186 | .Fn OBJ_add_object , | ||
| 187 | .Fn OBJ_create , | ||
| 188 | and | ||
| 189 | .Fn OBJ_create_objects , | ||
| 190 | the reason can be determined with | ||
| 191 | .Xr ERR_get_error 3 . | ||
| 192 | .Sh EXAMPLES | ||
| 193 | Create a new NID and initialize an object from it: | ||
| 194 | .Bd -literal -offset indent | ||
| 195 | int new_nid; | ||
| 196 | ASN1_OBJECT *obj; | ||
| 197 | |||
| 198 | new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); | ||
| 199 | obj = OBJ_nid2obj(new_nid); | ||
| 200 | .Ed | ||
| 201 | .Sh SEE ALSO | ||
| 202 | .Xr ASN1_OBJECT_new 3 , | ||
| 203 | .Xr OBJ_nid2obj 3 | ||
| 204 | .Sh HISTORY | ||
| 205 | .Fn OBJ_new_nid , | ||
| 206 | .Fn OBJ_add_object , | ||
| 207 | and | ||
| 208 | .Fn OBJ_cleanup | ||
| 209 | first appeared in SSLeay 0.8.0 and | ||
| 210 | .Fn OBJ_create | ||
| 211 | in SSLeay 0.9.0. | ||
| 212 | These functions have been available since | ||
| 213 | .Ox 2.4 . | ||
| 214 | .Sh CAVEATS | ||
| 215 | .Fn OBJ_add_object | ||
| 216 | indicates success even after adding an incomplete object that was created with | ||
| 217 | .Xr ASN1_OBJECT_create 3 | ||
| 218 | but lacks a short name, a long name, or an OID. | ||
| 219 | .Pp | ||
| 220 | Even | ||
| 221 | .Fn OBJ_create | ||
| 222 | tolerates | ||
| 223 | .Dv NULL | ||
| 224 | pointers being passed for the | ||
| 225 | .Fa sn | ||
| 226 | and/or | ||
| 227 | .Fa ln | ||
| 228 | arguments, in which case | ||
| 229 | .Xr OBJ_nid2sn 3 | ||
| 230 | and | ||
| 231 | .Xr OBJ_sn2nid 3 | ||
| 232 | or | ||
| 233 | .Xr OBJ_nid2ln 3 | ||
| 234 | and | ||
| 235 | .Xr OBJ_ln2nid 3 | ||
| 236 | will not work on the added object, respectively. | ||
| 237 | .Sh BUGS | ||
| 238 | .Fn OBJ_new_nid | ||
| 239 | does not reserve any return value to indicate an error. | ||
| 240 | Consequently, to avoid conflicting NID assignments and integer overflows, | ||
| 241 | care must be taken to not pass negative, zero, or large arguments to | ||
| 242 | .Fn OBJ_new_nid . | ||
| 243 | .Pp | ||
| 244 | .Fn OBJ_create_objects | ||
| 245 | does not distinguish between end of file, I/O errors, temporary | ||
| 246 | unavailability of data on a non-blocking BIO, invalid input syntax, | ||
| 247 | and memory allocation failure. | ||
| 248 | In all these cases, reading is aborted and the number of objects | ||
| 249 | that were already added is returned. | ||
