diff options
Diffstat (limited to 'src/lib/libcrypto/man/OBJ_nid2obj.3')
| -rw-r--r-- | src/lib/libcrypto/man/OBJ_nid2obj.3 | 479 |
1 files changed, 0 insertions, 479 deletions
diff --git a/src/lib/libcrypto/man/OBJ_nid2obj.3 b/src/lib/libcrypto/man/OBJ_nid2obj.3 deleted file mode 100644 index db9cd05c26..0000000000 --- a/src/lib/libcrypto/man/OBJ_nid2obj.3 +++ /dev/null | |||
| @@ -1,479 +0,0 @@ | |||
| 1 | .\" $OpenBSD: OBJ_nid2obj.3,v 1.15 2021/07/05 17:57:16 schwarze Exp $ | ||
| 2 | .\" OpenSSL c264592d May 14 11:28:00 2006 +0000 | ||
| 3 | .\" | ||
| 4 | .\" This file is a derived work. | ||
| 5 | .\" The changes are covered by the following Copyright and license: | ||
| 6 | .\" | ||
| 7 | .\" Copyright (c) 2017, 2021 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>. | ||
| 22 | .\" Copyright (c) 2002, 2006, 2015, 2016 The OpenSSL Project. | ||
| 23 | .\" All rights reserved. | ||
| 24 | .\" | ||
| 25 | .\" Redistribution and use in source and binary forms, with or without | ||
| 26 | .\" modification, are permitted provided that the following conditions | ||
| 27 | .\" are met: | ||
| 28 | .\" | ||
| 29 | .\" 1. Redistributions of source code must retain the above copyright | ||
| 30 | .\" notice, this list of conditions and the following disclaimer. | ||
| 31 | .\" | ||
| 32 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
| 33 | .\" notice, this list of conditions and the following disclaimer in | ||
| 34 | .\" the documentation and/or other materials provided with the | ||
| 35 | .\" distribution. | ||
| 36 | .\" | ||
| 37 | .\" 3. All advertising materials mentioning features or use of this | ||
| 38 | .\" software must display the following acknowledgment: | ||
| 39 | .\" "This product includes software developed by the OpenSSL Project | ||
| 40 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
| 41 | .\" | ||
| 42 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
| 43 | .\" endorse or promote products derived from this software without | ||
| 44 | .\" prior written permission. For written permission, please contact | ||
| 45 | .\" openssl-core@openssl.org. | ||
| 46 | .\" | ||
| 47 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
| 48 | .\" nor may "OpenSSL" appear in their names without prior written | ||
| 49 | .\" permission of the OpenSSL Project. | ||
| 50 | .\" | ||
| 51 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
| 52 | .\" acknowledgment: | ||
| 53 | .\" "This product includes software developed by the OpenSSL Project | ||
| 54 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
| 55 | .\" | ||
| 56 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
| 57 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
| 58 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 59 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
| 60 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 61 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
| 62 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
| 63 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
| 64 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
| 65 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
| 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
| 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 68 | .\" | ||
| 69 | .Dd $Mdocdate: July 5 2021 $ | ||
| 70 | .Dt OBJ_NID2OBJ 3 | ||
| 71 | .Os | ||
| 72 | .Sh NAME | ||
| 73 | .Nm OBJ_nid2obj , | ||
| 74 | .Nm OBJ_nid2ln , | ||
| 75 | .Nm OBJ_nid2sn , | ||
| 76 | .Nm OBJ_obj2nid , | ||
| 77 | .Nm OBJ_ln2nid , | ||
| 78 | .Nm OBJ_sn2nid , | ||
| 79 | .Nm OBJ_txt2nid , | ||
| 80 | .Nm OBJ_txt2obj , | ||
| 81 | .Nm OBJ_obj2txt , | ||
| 82 | .Nm OBJ_cmp , | ||
| 83 | .Nm OBJ_dup , | ||
| 84 | .Nm OBJ_create , | ||
| 85 | .Nm OBJ_cleanup , | ||
| 86 | .Nm i2t_ASN1_OBJECT , | ||
| 87 | .Nm i2a_ASN1_OBJECT | ||
| 88 | .Nd inspect and create ASN.1 object identifiers | ||
| 89 | .Sh SYNOPSIS | ||
| 90 | .In openssl/objects.h | ||
| 91 | .Ft ASN1_OBJECT * | ||
| 92 | .Fo OBJ_nid2obj | ||
| 93 | .Fa "int n" | ||
| 94 | .Fc | ||
| 95 | .Ft const char * | ||
| 96 | .Fo OBJ_nid2ln | ||
| 97 | .Fa "int n" | ||
| 98 | .Fc | ||
| 99 | .Ft const char * | ||
| 100 | .Fo OBJ_nid2sn | ||
| 101 | .Fa "int n" | ||
| 102 | .Fc | ||
| 103 | .Ft int | ||
| 104 | .Fo OBJ_obj2nid | ||
| 105 | .Fa "const ASN1_OBJECT *o" | ||
| 106 | .Fc | ||
| 107 | .Ft int | ||
| 108 | .Fo OBJ_ln2nid | ||
| 109 | .Fa "const char *ln" | ||
| 110 | .Fc | ||
| 111 | .Ft int | ||
| 112 | .Fo OBJ_sn2nid | ||
| 113 | .Fa "const char *sn" | ||
| 114 | .Fc | ||
| 115 | .Ft int | ||
| 116 | .Fo OBJ_txt2nid | ||
| 117 | .Fa "const char *s" | ||
| 118 | .Fc | ||
| 119 | .Ft ASN1_OBJECT * | ||
| 120 | .Fo OBJ_txt2obj | ||
| 121 | .Fa "const char *s" | ||
| 122 | .Fa "int no_name" | ||
| 123 | .Fc | ||
| 124 | .Ft int | ||
| 125 | .Fo OBJ_obj2txt | ||
| 126 | .Fa "char *buf" | ||
| 127 | .Fa "int buf_len" | ||
| 128 | .Fa "const ASN1_OBJECT *a" | ||
| 129 | .Fa "int no_name" | ||
| 130 | .Fc | ||
| 131 | .Ft int | ||
| 132 | .Fo OBJ_cmp | ||
| 133 | .Fa "const ASN1_OBJECT *a" | ||
| 134 | .Fa "const ASN1_OBJECT *b" | ||
| 135 | .Fc | ||
| 136 | .Ft ASN1_OBJECT * | ||
| 137 | .Fo OBJ_dup | ||
| 138 | .Fa "const ASN1_OBJECT *o" | ||
| 139 | .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 | ||
| 149 | .Ft int | ||
| 150 | .Fo i2t_ASN1_OBJECT | ||
| 151 | .Fa "char *buf" | ||
| 152 | .Fa "int buf_len" | ||
| 153 | .Fa "const ASN1_OBJECT *a" | ||
| 154 | .Fc | ||
| 155 | .Ft int | ||
| 156 | .Fo i2a_ASN1_OBJECT | ||
| 157 | .Fa "BIO *out_bio" | ||
| 158 | .Fa "const ASN1_OBJECT *a" | ||
| 159 | .Fc | ||
| 160 | .Sh DESCRIPTION | ||
| 161 | The ASN.1 object utility functions process | ||
| 162 | .Vt ASN1_OBJECT | ||
| 163 | structures which are a representation of the ASN.1 OBJECT IDENTIFIER | ||
| 164 | (OID) type. | ||
| 165 | For convenience, OIDs are usually represented in source code as | ||
| 166 | numeric identifiers, or NIDs. | ||
| 167 | OpenSSL has an internal table of OIDs that are generated when the | ||
| 168 | library is built, and their corresponding NIDs are available as | ||
| 169 | defined constants. | ||
| 170 | For the functions below, application code should treat all returned | ||
| 171 | values \(em OIDs, NIDs, or names \(em as constants. | ||
| 172 | .Pp | ||
| 173 | .Fn OBJ_nid2obj , | ||
| 174 | .Fn OBJ_nid2ln , | ||
| 175 | and | ||
| 176 | .Fn OBJ_nid2sn | ||
| 177 | convert the NID | ||
| 178 | .Fa n | ||
| 179 | to an | ||
| 180 | .Vt ASN1_OBJECT | ||
| 181 | structure, its long name, and its short name, respectively, or return | ||
| 182 | .Dv NULL | ||
| 183 | if an error occurred. | ||
| 184 | .Pp | ||
| 185 | .Fn OBJ_obj2nid , | ||
| 186 | .Fn OBJ_ln2nid , | ||
| 187 | and | ||
| 188 | .Fn OBJ_sn2nid | ||
| 189 | return the corresponding NID for the object | ||
| 190 | .Fa o , | ||
| 191 | the long name | ||
| 192 | .Fa ln , | ||
| 193 | or the short name | ||
| 194 | .Fa sn , | ||
| 195 | respectively, or | ||
| 196 | .Dv NID_undef | ||
| 197 | if an error occurred. | ||
| 198 | .Pp | ||
| 199 | .Fn OBJ_txt2nid | ||
| 200 | returns the NID corresponding to text string | ||
| 201 | .Fa s . | ||
| 202 | .Fa s | ||
| 203 | can be a long name, a short name, or the numerical representation | ||
| 204 | of an object. | ||
| 205 | .Pp | ||
| 206 | .Fn OBJ_txt2obj | ||
| 207 | converts the text string | ||
| 208 | .Fa s | ||
| 209 | into an | ||
| 210 | .Vt ASN1_OBJECT | ||
| 211 | structure. | ||
| 212 | If | ||
| 213 | .Fa no_name | ||
| 214 | is 0 then long names and short names will be interpreted as well as | ||
| 215 | numerical forms. | ||
| 216 | If | ||
| 217 | .Fa no_name | ||
| 218 | is 1 only the numerical form is acceptable. | ||
| 219 | .Pp | ||
| 220 | .Fn OBJ_obj2txt | ||
| 221 | converts the | ||
| 222 | .Vt ASN1_OBJECT | ||
| 223 | .Fa a | ||
| 224 | into a textual representation. | ||
| 225 | The representation is written as a NUL terminated string to | ||
| 226 | .Fa buf . | ||
| 227 | At most | ||
| 228 | .Fa buf_len | ||
| 229 | bytes are written, truncating the result if necessary. | ||
| 230 | The total amount of space required is returned. | ||
| 231 | If | ||
| 232 | .Fa no_name | ||
| 233 | is 0 and the object has a long or short name, then that will be used, | ||
| 234 | otherwise the numerical form will be used. | ||
| 235 | .Pp | ||
| 236 | .Fn i2t_ASN1_OBJECT | ||
| 237 | is the same as | ||
| 238 | .Fn OBJ_obj2txt | ||
| 239 | with | ||
| 240 | .Fa no_name | ||
| 241 | set to 0. | ||
| 242 | .Pp | ||
| 243 | .Fn i2a_ASN1_OBJECT | ||
| 244 | writes a textual representation of | ||
| 245 | .Fa a | ||
| 246 | to | ||
| 247 | .Fa out_bio | ||
| 248 | using | ||
| 249 | .Xr BIO_write 3 . | ||
| 250 | It does not write a terminating NUL byte. | ||
| 251 | If | ||
| 252 | .Fa a | ||
| 253 | is | ||
| 254 | .Dv NULL | ||
| 255 | or contains no data, it writes the 4-byte string | ||
| 256 | .Qq NULL . | ||
| 257 | If | ||
| 258 | .Fn i2t_ASN1_OBJECT | ||
| 259 | fails, | ||
| 260 | .Fn i2a_ASN1_OBJECT | ||
| 261 | writes the 9-byte string | ||
| 262 | .Qq <INVALID> . | ||
| 263 | Otherwise, it writes the string constructed with | ||
| 264 | .Fn i2t_ASN1_OBJECT . | ||
| 265 | .Pp | ||
| 266 | .Fn OBJ_cmp | ||
| 267 | compares | ||
| 268 | .Fa a | ||
| 269 | to | ||
| 270 | .Fa b . | ||
| 271 | If the two are identical, 0 is returned. | ||
| 272 | .Pp | ||
| 273 | .Fn OBJ_dup | ||
| 274 | returns a deep copy of | ||
| 275 | .Fa o | ||
| 276 | if | ||
| 277 | .Fa o | ||
| 278 | is marked as dynamically allocated. | ||
| 279 | The new object and all data contained in it is marked as dynamically | ||
| 280 | allocated. | ||
| 281 | If | ||
| 282 | .Fa o | ||
| 283 | is not marked as dynamically allocated, | ||
| 284 | .Fn OBJ_dup | ||
| 285 | just returns | ||
| 286 | .Fa o | ||
| 287 | itself. | ||
| 288 | .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 | ||
| 313 | identifier (NID) associated with them. | ||
| 314 | A standard set of objects is represented in an internal table. | ||
| 315 | The appropriate values are defined in the header file | ||
| 316 | .In openssl/objects.h . | ||
| 317 | .Pp | ||
| 318 | For example, the OID for commonName has the following definitions: | ||
| 319 | .Bd -literal | ||
| 320 | #define SN_commonName "CN" | ||
| 321 | #define LN_commonName "commonName" | ||
| 322 | #define NID_commonName 13 | ||
| 323 | .Ed | ||
| 324 | .Pp | ||
| 325 | New objects can be added by calling | ||
| 326 | .Fn OBJ_create . | ||
| 327 | .Pp | ||
| 328 | Table objects have certain advantages over other objects: for example | ||
| 329 | their NIDs can be used in a C language switch statement. | ||
| 330 | They are also static constant structures which are shared: that is there | ||
| 331 | is only a single constant structure for each table object. | ||
| 332 | .Pp | ||
| 333 | Objects which are not in the table have the NID value | ||
| 334 | .Dv NID_undef . | ||
| 335 | .Pp | ||
| 336 | Objects do not need to be in the internal tables to be processed: | ||
| 337 | the functions | ||
| 338 | .Fn OBJ_txt2obj | ||
| 339 | and | ||
| 340 | .Fn OBJ_obj2txt | ||
| 341 | can process the numerical form of an OID. | ||
| 342 | .Sh RETURN VALUES | ||
| 343 | .Fn OBJ_nid2obj , | ||
| 344 | .Fn OBJ_txt2obj , | ||
| 345 | and | ||
| 346 | .Fn OBJ_dup | ||
| 347 | return an | ||
| 348 | .Vt ASN1_OBJECT | ||
| 349 | object or | ||
| 350 | .Dv NULL | ||
| 351 | if an error occurs. | ||
| 352 | .Pp | ||
| 353 | .Fn OBJ_nid2ln | ||
| 354 | and | ||
| 355 | .Fn OBJ_nid2sn | ||
| 356 | return a valid string or | ||
| 357 | .Dv NULL | ||
| 358 | on error. | ||
| 359 | .Pp | ||
| 360 | .Fn OBJ_obj2nid , | ||
| 361 | .Fn OBJ_ln2nid , | ||
| 362 | .Fn OBJ_sn2nid , | ||
| 363 | and | ||
| 364 | .Fn OBJ_txt2nid | ||
| 365 | return a NID or | ||
| 366 | .Dv NID_undef | ||
| 367 | on error. | ||
| 368 | .Pp | ||
| 369 | .Fn OBJ_obj2txt | ||
| 370 | and | ||
| 371 | .Fn i2t_ASN1_OBJECT | ||
| 372 | return the amount of space required in bytes, | ||
| 373 | including the terminating NUL byte. | ||
| 374 | .Pp | ||
| 375 | .Fn i2a_ASN1_OBJECT | ||
| 376 | returns the number of bytes written, even if | ||
| 377 | .Fa a | ||
| 378 | is invalid or contains invalid data, | ||
| 379 | but a negative value if memory allocation or a write operation fails. | ||
| 380 | .Pp | ||
| 381 | .Fn OBJ_cmp | ||
| 382 | returns 0 if the contents of | ||
| 383 | .Fa a | ||
| 384 | and | ||
| 385 | .Fa b | ||
| 386 | are identical, or non-zero otherwise. | ||
| 387 | .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 | ||
| 394 | .Fn OBJ_nid2obj , | ||
| 395 | .Fn OBJ_nid2ln , | ||
| 396 | .Fn OBJ_nid2sn , | ||
| 397 | .Fn OBJ_txt2nid , | ||
| 398 | .Fn OBJ_txt2obj , | ||
| 399 | .Fn OBJ_obj2txt , | ||
| 400 | .Fn OBJ_dup , | ||
| 401 | .Fn OBJ_create , | ||
| 402 | .Fn i2t_ASN1_OBJECT , | ||
| 403 | and | ||
| 404 | .Fn i2a_ASN1_OBJECT , | ||
| 405 | the reason can be determined with | ||
| 406 | .Xr ERR_get_error 3 . | ||
| 407 | .Sh EXAMPLES | ||
| 408 | Create an object for | ||
| 409 | .Sy commonName : | ||
| 410 | .Bd -literal -offset indent | ||
| 411 | ASN1_OBJECT *o; | ||
| 412 | o = OBJ_nid2obj(NID_commonName); | ||
| 413 | .Ed | ||
| 414 | .Pp | ||
| 415 | Check if an object is | ||
| 416 | .Sy commonName : | ||
| 417 | .Bd -literal -offset indent | ||
| 418 | if (OBJ_obj2nid(obj) == NID_commonName) | ||
| 419 | /* Do something */ | ||
| 420 | .Ed | ||
| 421 | .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: | ||
| 431 | .Bd -literal -offset indent | ||
| 432 | obj = OBJ_txt2obj("1.2.3.4", 1); | ||
| 433 | .Ed | ||
| 434 | .Sh SEE ALSO | ||
| 435 | .Xr ASN1_OBJECT_new 3 , | ||
| 436 | .Xr BIO_new 3 , | ||
| 437 | .Xr d2i_ASN1_OBJECT 3 | ||
| 438 | .Sh HISTORY | ||
| 439 | .Fn OBJ_nid2obj , | ||
| 440 | .Fn OBJ_nid2ln , | ||
| 441 | .Fn OBJ_nid2sn , | ||
| 442 | .Fn OBJ_obj2nid , | ||
| 443 | .Fn OBJ_ln2nid , | ||
| 444 | .Fn OBJ_sn2nid , | ||
| 445 | .Fn OBJ_txt2nid , | ||
| 446 | .Fn OBJ_cmp , | ||
| 447 | and | ||
| 448 | .Fn OBJ_dup | ||
| 449 | first appeared in SSLeay 0.5.1. | ||
| 450 | .Fn i2a_ASN1_OBJECT | ||
| 451 | first appeared in SSLeay 0.6.0, | ||
| 452 | .Fn OBJ_cleanup | ||
| 453 | in SSLeay 0.8.0, and | ||
| 454 | .Fn OBJ_create | ||
| 455 | and | ||
| 456 | .Fn i2t_ASN1_OBJECT | ||
| 457 | in SSLeay 0.9.0. | ||
| 458 | All these functions have been available since | ||
| 459 | .Ox 2.4 . | ||
| 460 | .Pp | ||
| 461 | .Fn OBJ_txt2obj | ||
| 462 | first appeared in OpenSSL 0.9.2b. | ||
| 463 | .Fn OBJ_obj2txt | ||
| 464 | first appeared in OpenSSL 0.9.4. | ||
| 465 | Both functions have been available since | ||
| 466 | .Ox 2.6 . | ||
| 467 | .Sh BUGS | ||
| 468 | .Fn OBJ_obj2txt | ||
| 469 | is awkward and messy to use: it doesn't follow the convention of other | ||
| 470 | OpenSSL functions where the buffer can be set to | ||
| 471 | .Dv NULL | ||
| 472 | to determine the amount of data that should be written. | ||
| 473 | Instead | ||
| 474 | .Fa buf | ||
| 475 | must point to a valid buffer and | ||
| 476 | .Fa buf_len | ||
| 477 | should be set to a positive value. | ||
| 478 | A buffer length of 80 should be more than enough to handle any OID | ||
| 479 | encountered in practice. | ||
