diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_TYPE_get.3 | 86 |
1 files changed, 77 insertions, 9 deletions
diff --git a/src/lib/libcrypto/man/ASN1_TYPE_get.3 b/src/lib/libcrypto/man/ASN1_TYPE_get.3 index d4123cb3a9..1a80ddccbc 100644 --- a/src/lib/libcrypto/man/ASN1_TYPE_get.3 +++ b/src/lib/libcrypto/man/ASN1_TYPE_get.3 | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.14 2021/11/23 14:58:08 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.15 2021/11/23 17:53:59 schwarze Exp $ |
| 2 | .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 | 2 | .\" selective merge up to: OpenSSL 6328d367 Jul 4 21:58:30 2020 +0200 |
| 3 | .\" | 3 | .\" |
| 4 | .\" This file is a derived work. | 4 | .\" This file is a derived work. |
| 5 | .\" The changes are covered by the following Copyright and license: | 5 | .\" The changes are covered by the following Copyright and license: |
| @@ -76,6 +76,8 @@ | |||
| 76 | .Nm ASN1_TYPE_set1 , | 76 | .Nm ASN1_TYPE_set1 , |
| 77 | .Nm ASN1_TYPE_set_octetstring , | 77 | .Nm ASN1_TYPE_set_octetstring , |
| 78 | .Nm ASN1_TYPE_get_octetstring , | 78 | .Nm ASN1_TYPE_get_octetstring , |
| 79 | .Nm ASN1_TYPE_set_int_octetstring , | ||
| 80 | .Nm ASN1_TYPE_get_int_octetstring , | ||
| 79 | .Nm ASN1_TYPE_cmp | 81 | .Nm ASN1_TYPE_cmp |
| 80 | .Nd ASN.1 objects of arbitrary type | 82 | .Nd ASN.1 objects of arbitrary type |
| 81 | .Sh SYNOPSIS | 83 | .Sh SYNOPSIS |
| @@ -113,6 +115,20 @@ | |||
| 113 | .Fa "int buflen" | 115 | .Fa "int buflen" |
| 114 | .Fc | 116 | .Fc |
| 115 | .Ft int | 117 | .Ft int |
| 118 | .Fo ASN1_TYPE_set_int_octetstring | ||
| 119 | .Fa "ASN1_TYPE *a" | ||
| 120 | .Fa "long num" | ||
| 121 | .Fa "const unsigned char *data" | ||
| 122 | .Fa "int len" | ||
| 123 | .Fc | ||
| 124 | .Ft int | ||
| 125 | .Fo ASN1_TYPE_get_int_octetstring | ||
| 126 | .Fa "const ASN1_TYPE *a", | ||
| 127 | .Fa "long *num" | ||
| 128 | .Fa "unsigned char *buffer", | ||
| 129 | .Fa "int buflen" | ||
| 130 | .Fc | ||
| 131 | .Ft int | ||
| 116 | .Fo ASN1_TYPE_cmp | 132 | .Fo ASN1_TYPE_cmp |
| 117 | .Fa "const ASN1_TYPE *a" | 133 | .Fa "const ASN1_TYPE *a" |
| 118 | .Fa "const ASN1_TYPE *b" | 134 | .Fa "const ASN1_TYPE *b" |
| @@ -257,6 +273,40 @@ bytes, into the | |||
| 257 | .Fa buffer | 273 | .Fa buffer |
| 258 | provided by the caller. | 274 | provided by the caller. |
| 259 | .Pp | 275 | .Pp |
| 276 | .Fn ASN1_TYPE_set_int_octetstring | ||
| 277 | frees the value contained in | ||
| 278 | .Fa a , | ||
| 279 | if any, sets its type to | ||
| 280 | .Dv V_ASN1_SEQUENCE , | ||
| 281 | and sets its value to a two-element ASN.1 sequence consisting of | ||
| 282 | an ASN.1 INTEGER object with the value | ||
| 283 | .Fa num | ||
| 284 | and an ASN.1 OCTET STRING object | ||
| 285 | containing a copy of the | ||
| 286 | .Fa len | ||
| 287 | bytes pointed to by | ||
| 288 | .Fa data . | ||
| 289 | .Pp | ||
| 290 | .Fn ASN1_TYPE_get_int_octetstring | ||
| 291 | copies the integer value from the first element of the ASN.1 sequence | ||
| 292 | .Fa a | ||
| 293 | to | ||
| 294 | .Pf * Fa num | ||
| 295 | unless | ||
| 296 | .Fa num | ||
| 297 | is a | ||
| 298 | .Dv NULL | ||
| 299 | pointer and copies the octet string value from the second elememt, | ||
| 300 | but not more than | ||
| 301 | .Fa buflen | ||
| 302 | bytes, into the | ||
| 303 | .Fa buffer | ||
| 304 | provided by the caller unless | ||
| 305 | .Fa buffer | ||
| 306 | is a | ||
| 307 | .Dv NULL | ||
| 308 | pointer. | ||
| 309 | .Pp | ||
| 260 | .Fn ASN1_TYPE_cmp | 310 | .Fn ASN1_TYPE_cmp |
| 261 | checks that | 311 | checks that |
| 262 | .Fa a | 312 | .Fa a |
| @@ -283,7 +333,7 @@ the two types could be absent OPTIONAL fields and so should match, | |||
| 283 | however passing | 333 | however passing |
| 284 | .Dv NULL | 334 | .Dv NULL |
| 285 | values could also indicate a programming error (for example an | 335 | values could also indicate a programming error (for example an |
| 286 | unparseable type which returns | 336 | unparsable type which returns |
| 287 | .Dv NULL ) | 337 | .Dv NULL ) |
| 288 | for types which do | 338 | for types which do |
| 289 | .Sy not | 339 | .Sy not |
| @@ -309,10 +359,11 @@ For example, it will always happen for empty objects | |||
| 309 | newly constructed with | 359 | newly constructed with |
| 310 | .Fn ASN1_TYPE_new . | 360 | .Fn ASN1_TYPE_new . |
| 311 | .Pp | 361 | .Pp |
| 312 | .Fn ASN1_TYPE_set1 | 362 | .Fn ASN1_TYPE_set1 , |
| 363 | .Fn ASN1_TYPE_set_octetstring , | ||
| 313 | and | 364 | and |
| 314 | .Fn ASN1_TYPE_set_octetstring | 365 | .Fn ASN1_TYPE_set_int_octetstring |
| 315 | return 1 if the copying succeeds or 0 if it fails. | 366 | return 1 on success or 0 on failure. |
| 316 | .Pp | 367 | .Pp |
| 317 | .Fn ASN1_TYPE_get_octetstring | 368 | .Fn ASN1_TYPE_get_octetstring |
| 318 | returns the number of data bytes contained in the | 369 | returns the number of data bytes contained in the |
| @@ -329,6 +380,21 @@ If the return value is greater than the | |||
| 329 | argument, the content was truncated when copied to the | 380 | argument, the content was truncated when copied to the |
| 330 | .Fa buffer . | 381 | .Fa buffer . |
| 331 | .Pp | 382 | .Pp |
| 383 | .Fn ASN1_TYPE_get_int_octetstring | ||
| 384 | returns the number of data bytes contained in the | ||
| 385 | .Vt ASN1_OCTET_STRING | ||
| 386 | object that is the second element of the ASN.1 sequence | ||
| 387 | .Fa a | ||
| 388 | or \-1 if | ||
| 389 | .Fa a | ||
| 390 | is not of the type | ||
| 391 | .Dv V_ASN1_SEQUENCE | ||
| 392 | or if decoding fails. | ||
| 393 | If the return value is greater than the | ||
| 394 | .Fa buflen | ||
| 395 | argument, the content was truncated when copied to the | ||
| 396 | .Fa buffer . | ||
| 397 | .Pp | ||
| 332 | .Fn ASN1_TYPE_cmp | 398 | .Fn ASN1_TYPE_cmp |
| 333 | returns 0 for a match or non-zero for a mismatch. | 399 | returns 0 for a match or non-zero for a mismatch. |
| 334 | .Sh SEE ALSO | 400 | .Sh SEE ALSO |
| @@ -350,14 +416,16 @@ returns 0 for a match or non-zero for a mismatch. | |||
| 350 | .Fn ASN1_TYPE_new | 416 | .Fn ASN1_TYPE_new |
| 351 | and | 417 | and |
| 352 | .Fn ASN1_TYPE_free | 418 | .Fn ASN1_TYPE_free |
| 353 | first appeared in SSLeay 0.5.1. | 419 | first appeared in SSLeay 0.5.1, |
| 354 | .Fn ASN1_TYPE_get | 420 | .Fn ASN1_TYPE_get |
| 355 | and | 421 | and |
| 356 | .Fn ASN1_TYPE_set | 422 | .Fn ASN1_TYPE_set |
| 357 | in SSLeay 0.8.0, and | 423 | in SSLeay 0.8.0, and |
| 358 | .Fn ASN1_TYPE_set_octetstring | 424 | .Fn ASN1_TYPE_set_octetstring , |
| 425 | .Fn ASN1_TYPE_get_octetstring , | ||
| 426 | .Fn ASN1_TYPE_set_int_octetstring , | ||
| 359 | and | 427 | and |
| 360 | .Fn ASN1_TYPE_get_octetstring | 428 | .Fn ASN1_TYPE_get_int_octetstring |
| 361 | in SSLeay 0.9.0. | 429 | in SSLeay 0.9.0. |
| 362 | These functions have been available since | 430 | These functions have been available since |
| 363 | .Ox 2.4 . | 431 | .Ox 2.4 . |
