diff options
| author | schwarze <> | 2021-11-23 14:58:08 +0000 |
|---|---|---|
| committer | schwarze <> | 2021-11-23 14:58:08 +0000 |
| commit | 4f3472fc5bfb7c360db69e0795df95f0edeb055d (patch) | |
| tree | f287e45eac83c46e28f645598a5e519e048dfe5b /src | |
| parent | 78eb35459b09366e67f2b74a1cc209dbbd6bc6a8 (diff) | |
| download | openbsd-4f3472fc5bfb7c360db69e0795df95f0edeb055d.tar.gz openbsd-4f3472fc5bfb7c360db69e0795df95f0edeb055d.tar.bz2 openbsd-4f3472fc5bfb7c360db69e0795df95f0edeb055d.zip | |
document ASN1_TYPE_set_octetstring(3) and ASN1_TYPE_get_octetstring(3)
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/man/ASN1_TYPE_get.3 | 72 |
1 files changed, 67 insertions, 5 deletions
diff --git a/src/lib/libcrypto/man/ASN1_TYPE_get.3 b/src/lib/libcrypto/man/ASN1_TYPE_get.3 index 6a7d761f94..d4123cb3a9 100644 --- a/src/lib/libcrypto/man/ASN1_TYPE_get.3 +++ b/src/lib/libcrypto/man/ASN1_TYPE_get.3 | |||
| @@ -1,10 +1,10 @@ | |||
| 1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.13 2021/11/21 15:11:01 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_TYPE_get.3,v 1.14 2021/11/23 14:58:08 schwarze Exp $ |
| 2 | .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 | 2 | .\" OpenSSL 99d63d46 Mon Jun 6 00:43:05 2016 -0400 |
| 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: |
| 6 | .\" | 6 | .\" |
| 7 | .\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org> | 7 | .\" Copyright (c) 2017, 2021 Ingo Schwarze <schwarze@openbsd.org> |
| 8 | .\" | 8 | .\" |
| 9 | .\" Permission to use, copy, modify, and distribute this software for any | 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 | 10 | .\" purpose with or without fee is hereby granted, provided that the above |
| @@ -65,7 +65,7 @@ | |||
| 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 65 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
| 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 66 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
| 67 | .\" | 67 | .\" |
| 68 | .Dd $Mdocdate: November 21 2021 $ | 68 | .Dd $Mdocdate: November 23 2021 $ |
| 69 | .Dt ASN1_TYPE_GET 3 | 69 | .Dt ASN1_TYPE_GET 3 |
| 70 | .Os | 70 | .Os |
| 71 | .Sh NAME | 71 | .Sh NAME |
| @@ -74,6 +74,8 @@ | |||
| 74 | .Nm ASN1_TYPE_get , | 74 | .Nm ASN1_TYPE_get , |
| 75 | .Nm ASN1_TYPE_set , | 75 | .Nm ASN1_TYPE_set , |
| 76 | .Nm ASN1_TYPE_set1 , | 76 | .Nm ASN1_TYPE_set1 , |
| 77 | .Nm ASN1_TYPE_set_octetstring , | ||
| 78 | .Nm ASN1_TYPE_get_octetstring , | ||
| 77 | .Nm ASN1_TYPE_cmp | 79 | .Nm ASN1_TYPE_cmp |
| 78 | .Nd ASN.1 objects of arbitrary type | 80 | .Nd ASN.1 objects of arbitrary type |
| 79 | .Sh SYNOPSIS | 81 | .Sh SYNOPSIS |
| @@ -99,6 +101,18 @@ | |||
| 99 | .Fa "const void *value" | 101 | .Fa "const void *value" |
| 100 | .Fc | 102 | .Fc |
| 101 | .Ft int | 103 | .Ft int |
| 104 | .Fo ASN1_TYPE_set_octetstring | ||
| 105 | .Fa "ASN1_TYPE *a" | ||
| 106 | .Fa "const unsigned char *data" | ||
| 107 | .Fa "int len" | ||
| 108 | .Fc | ||
| 109 | .Ft int | ||
| 110 | .Fo ASN1_TYPE_get_octetstring | ||
| 111 | .Fa "const ASN1_TYPE *a" | ||
| 112 | .Fa "unsigned char *buffer" | ||
| 113 | .Fa "int buflen" | ||
| 114 | .Fc | ||
| 115 | .Ft int | ||
| 102 | .Fo ASN1_TYPE_cmp | 116 | .Fo ASN1_TYPE_cmp |
| 103 | .Fa "const ASN1_TYPE *a" | 117 | .Fa "const ASN1_TYPE *a" |
| 104 | .Fa "const ASN1_TYPE *b" | 118 | .Fa "const ASN1_TYPE *b" |
| @@ -216,6 +230,33 @@ then the | |||
| 216 | contains the entire ASN.1 encoding verbatim, including tag and | 230 | contains the entire ASN.1 encoding verbatim, including tag and |
| 217 | length octets. | 231 | length octets. |
| 218 | .Pp | 232 | .Pp |
| 233 | .Fn ASN1_TYPE_set_octetstring | ||
| 234 | allocates a new | ||
| 235 | .Vt ASN1_OCTET_STRING | ||
| 236 | object, copies | ||
| 237 | .Fa len | ||
| 238 | bytes of | ||
| 239 | .Fa data | ||
| 240 | into it using | ||
| 241 | .Xr ASN1_STRING_set 3 , | ||
| 242 | and replaces the value of | ||
| 243 | .Fa a | ||
| 244 | with it by calling | ||
| 245 | .Fn ASN1_TYPE_set | ||
| 246 | with a type of | ||
| 247 | .Dv V_ASN1_OCTET_STRING . | ||
| 248 | .Pp | ||
| 249 | .Fn ASN1_TYPE_get_octetstring | ||
| 250 | copies the contents of the | ||
| 251 | .Vt ASN1_OCTET_STRING | ||
| 252 | object contained in | ||
| 253 | .Fa a , | ||
| 254 | but not more than | ||
| 255 | .Fa buflen | ||
| 256 | bytes, into the | ||
| 257 | .Fa buffer | ||
| 258 | provided by the caller. | ||
| 259 | .Pp | ||
| 219 | .Fn ASN1_TYPE_cmp | 260 | .Fn ASN1_TYPE_cmp |
| 220 | checks that | 261 | checks that |
| 221 | .Fa a | 262 | .Fa a |
| @@ -269,7 +310,24 @@ newly constructed with | |||
| 269 | .Fn ASN1_TYPE_new . | 310 | .Fn ASN1_TYPE_new . |
| 270 | .Pp | 311 | .Pp |
| 271 | .Fn ASN1_TYPE_set1 | 312 | .Fn ASN1_TYPE_set1 |
| 272 | returns 1 if the copying succeeds or 0 if it fails. | 313 | and |
| 314 | .Fn ASN1_TYPE_set_octetstring | ||
| 315 | return 1 if the copying succeeds or 0 if it fails. | ||
| 316 | .Pp | ||
| 317 | .Fn ASN1_TYPE_get_octetstring | ||
| 318 | returns the number of data bytes contained in the | ||
| 319 | .Vt ASN1_OCTET_STRING | ||
| 320 | object contained in | ||
| 321 | .Fa a | ||
| 322 | or \-1 if | ||
| 323 | .Fa a | ||
| 324 | is not of the type | ||
| 325 | .Dv V_ASN1_OCTET_STRING | ||
| 326 | or does not contain any object. | ||
| 327 | If the return value is greater than the | ||
| 328 | .Fa buflen | ||
| 329 | argument, the content was truncated when copied to the | ||
| 330 | .Fa buffer . | ||
| 273 | .Pp | 331 | .Pp |
| 274 | .Fn ASN1_TYPE_cmp | 332 | .Fn ASN1_TYPE_cmp |
| 275 | returns 0 for a match or non-zero for a mismatch. | 333 | returns 0 for a match or non-zero for a mismatch. |
| @@ -296,7 +354,11 @@ first appeared in SSLeay 0.5.1. | |||
| 296 | .Fn ASN1_TYPE_get | 354 | .Fn ASN1_TYPE_get |
| 297 | and | 355 | and |
| 298 | .Fn ASN1_TYPE_set | 356 | .Fn ASN1_TYPE_set |
| 299 | first appeared in SSLeay 0.8.0. | 357 | in SSLeay 0.8.0, and |
| 358 | .Fn ASN1_TYPE_set_octetstring | ||
| 359 | and | ||
| 360 | .Fn ASN1_TYPE_get_octetstring | ||
| 361 | in SSLeay 0.9.0. | ||
| 300 | These functions have been available since | 362 | These functions have been available since |
| 301 | .Ox 2.4 . | 363 | .Ox 2.4 . |
| 302 | .Pp | 364 | .Pp |
