diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/man/d2i_ASN1_OCTET_STRING.3 | 53 |
1 files changed, 46 insertions, 7 deletions
diff --git a/src/lib/libcrypto/man/d2i_ASN1_OCTET_STRING.3 b/src/lib/libcrypto/man/d2i_ASN1_OCTET_STRING.3 index b6c62106b7..faccbe6ad9 100644 --- a/src/lib/libcrypto/man/d2i_ASN1_OCTET_STRING.3 +++ b/src/lib/libcrypto/man/d2i_ASN1_OCTET_STRING.3 | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | .\" $OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.15 2021/12/14 20:14:22 schwarze Exp $ | 1 | .\" $OpenBSD: d2i_ASN1_OCTET_STRING.3,v 1.16 2021/12/15 15:29:23 schwarze Exp $ |
| 2 | .\" | 2 | .\" |
| 3 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 3 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> |
| 4 | .\" | 4 | .\" |
| @@ -14,7 +14,7 @@ | |||
| 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
| 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
| 16 | .\" | 16 | .\" |
| 17 | .Dd $Mdocdate: December 14 2021 $ | 17 | .Dd $Mdocdate: December 15 2021 $ |
| 18 | .Dt D2I_ASN1_OCTET_STRING 3 | 18 | .Dt D2I_ASN1_OCTET_STRING 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -24,6 +24,7 @@ | |||
| 24 | .Nm i2d_ASN1_BIT_STRING , | 24 | .Nm i2d_ASN1_BIT_STRING , |
| 25 | .Nm d2i_ASN1_INTEGER , | 25 | .Nm d2i_ASN1_INTEGER , |
| 26 | .Nm i2d_ASN1_INTEGER , | 26 | .Nm i2d_ASN1_INTEGER , |
| 27 | .Nm i2c_ASN1_INTEGER , | ||
| 27 | .Nm d2i_ASN1_UINTEGER , | 28 | .Nm d2i_ASN1_UINTEGER , |
| 28 | .Nm d2i_ASN1_ENUMERATED , | 29 | .Nm d2i_ASN1_ENUMERATED , |
| 29 | .Nm i2d_ASN1_ENUMERATED , | 30 | .Nm i2d_ASN1_ENUMERATED , |
| @@ -94,6 +95,11 @@ | |||
| 94 | .Fa "ASN1_INTEGER *val_in" | 95 | .Fa "ASN1_INTEGER *val_in" |
| 95 | .Fa "unsigned char **der_out" | 96 | .Fa "unsigned char **der_out" |
| 96 | .Fc | 97 | .Fc |
| 98 | .Ft int | ||
| 99 | .Fo i2c_ASN1_INTEGER | ||
| 100 | .Fa "ASN1_INTEGER *val_in" | ||
| 101 | .Fa "unsigned char **der_out" | ||
| 102 | .Fc | ||
| 97 | .Ft ASN1_INTEGER * | 103 | .Ft ASN1_INTEGER * |
| 98 | .Fo d2i_ASN1_UINTEGER | 104 | .Fo d2i_ASN1_UINTEGER |
| 99 | .Fa "ASN1_INTEGER **val_out" | 105 | .Fa "ASN1_INTEGER **val_out" |
| @@ -273,10 +279,9 @@ objects. | |||
| 273 | For details about the semantics, examples, caveats, and bugs, see | 279 | For details about the semantics, examples, caveats, and bugs, see |
| 274 | .Xr ASN1_item_d2i 3 . | 280 | .Xr ASN1_item_d2i 3 . |
| 275 | .Pp | 281 | .Pp |
| 276 | The format consists of one identifier octet, | 282 | The format consists of one identifier byte, one or more length bytes, |
| 277 | one or more length octets, | 283 | and one or more content bytes. |
| 278 | and one or more content octets. | 284 | The identifier bytes and corresponding ASN.1 types are as follows: |
| 279 | The identifier octets and corresponding ASN.1 types are as follows: | ||
| 280 | .Bl -column ASN1_GENERALIZEDTIME identifier | 285 | .Bl -column ASN1_GENERALIZEDTIME identifier |
| 281 | .It Em OpenSSL type Ta Em identifier Ta Em ASN.1 type | 286 | .It Em OpenSSL type Ta Em identifier Ta Em ASN.1 type |
| 282 | .It Ta | 287 | .It Ta |
| @@ -296,6 +301,27 @@ The identifier octets and corresponding ASN.1 types are as follows: | |||
| 296 | .It Vt ASN1_UTCTIME Ta 0x17 Ta UTCTime | 301 | .It Vt ASN1_UTCTIME Ta 0x17 Ta UTCTime |
| 297 | .El | 302 | .El |
| 298 | .Pp | 303 | .Pp |
| 304 | .Fn i2c_ASN1_INTEGER | ||
| 305 | writes only the content bytes of | ||
| 306 | .Fa val_in | ||
| 307 | to | ||
| 308 | .Pf * Fa der_out | ||
| 309 | and advances | ||
| 310 | .Pf * Fa der_out | ||
| 311 | to the byte after the last one written. | ||
| 312 | The identifier and content length bytes are not written. | ||
| 313 | It is the responsibility of the caller to make sure that the buffer | ||
| 314 | pointed to by | ||
| 315 | .Pf * Fa der_out | ||
| 316 | is long enough, such that no buffer overflow can occur. | ||
| 317 | This function does not support automatic memory allocation. | ||
| 318 | If | ||
| 319 | .Fa der_out | ||
| 320 | is a | ||
| 321 | .Dv NULL | ||
| 322 | pointer, the function only calculates the number of content bytes | ||
| 323 | that would be written, without writing them anywhere. | ||
| 324 | .Pp | ||
| 299 | .Fn d2i_DIRECTORYSTRING | 325 | .Fn d2i_DIRECTORYSTRING |
| 300 | and | 326 | and |
| 301 | .Fn i2d_DIRECTORYSTRING | 327 | .Fn i2d_DIRECTORYSTRING |
| @@ -320,7 +346,7 @@ and | |||
| 320 | .Fn i2d_DIRECTORYSTRING | 346 | .Fn i2d_DIRECTORYSTRING |
| 321 | that also accept IA5String, NumericString, BIT STRING, and SEQUENCE | 347 | that also accept IA5String, NumericString, BIT STRING, and SEQUENCE |
| 322 | ASN.1 values as well as ASN.1 values with unknown identifier | 348 | ASN.1 values as well as ASN.1 values with unknown identifier |
| 323 | octets (0x07, 0x08, 0x09, 0x0b, 0x0d, 0x0e, 0x0f, 0x1d, and 0x1f). | 349 | bytes (0x07, 0x08, 0x09, 0x0b, 0x0d, 0x0e, 0x0f, 0x1d, and 0x1f). |
| 324 | Even though the standard requires the use of | 350 | Even though the standard requires the use of |
| 325 | .Vt DirectoryString | 351 | .Vt DirectoryString |
| 326 | in the relative distinguished names described in | 352 | in the relative distinguished names described in |
| @@ -392,6 +418,15 @@ The | |||
| 392 | .Fn i2d_* | 418 | .Fn i2d_* |
| 393 | encoding functions return the number of bytes successfully encoded | 419 | encoding functions return the number of bytes successfully encoded |
| 394 | or a negative value if an error occurs. | 420 | or a negative value if an error occurs. |
| 421 | .Pp | ||
| 422 | .Fn i2c_ASN1_INTEGER | ||
| 423 | returns the number of content bytes that were or would be written or 0 if | ||
| 424 | .Fa val_in | ||
| 425 | is a | ||
| 426 | .Dv NULL | ||
| 427 | pointer or if its | ||
| 428 | .Xr ASN1_STRING_length 3 | ||
| 429 | is negative. | ||
| 395 | .Sh SEE ALSO | 430 | .Sh SEE ALSO |
| 396 | .Xr ASN1_item_d2i 3 , | 431 | .Xr ASN1_item_d2i 3 , |
| 397 | .Xr ASN1_STRING_new 3 | 432 | .Xr ASN1_STRING_new 3 |
| @@ -449,6 +484,10 @@ first appeared in OpenSSL 0.9.3. | |||
| 449 | These functions have been available since | 484 | These functions have been available since |
| 450 | .Ox 2.6 . | 485 | .Ox 2.6 . |
| 451 | .Pp | 486 | .Pp |
| 487 | .Fn i2c_ASN1_INTEGER | ||
| 488 | first appeared in OpenSSL 0.9.6 and has been available since | ||
| 489 | .Ox 2.9 . | ||
| 490 | .Pp | ||
| 452 | .Fn d2i_ASN1_UNIVERSALSTRING , | 491 | .Fn d2i_ASN1_UNIVERSALSTRING , |
| 453 | .Fn i2d_ASN1_UNIVERSALSTRING , | 492 | .Fn i2d_ASN1_UNIVERSALSTRING , |
| 454 | .Fn d2i_ASN1_GENERALSTRING , | 493 | .Fn d2i_ASN1_GENERALSTRING , |
