diff options
author | schwarze <> | 2021-10-25 10:26:21 +0000 |
---|---|---|
committer | schwarze <> | 2021-10-25 10:26:21 +0000 |
commit | 0e1dfee67fce5df9c6b4694351bc4fba5e38a19e (patch) | |
tree | 5002aee60966ff771e06b18f7f974127e47e663a /src | |
parent | e3f2ec519b25cefd4a104b2b27e0831a9b500067 (diff) | |
download | openbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.tar.gz openbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.tar.bz2 openbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.zip |
document ASN1_STRING_set0(3)
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libcrypto/man/ASN1_STRING_length.3 | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/ASN1_STRING_length.3 b/src/lib/libcrypto/man/ASN1_STRING_length.3 index 76679e27e9..27bb6632a5 100644 --- a/src/lib/libcrypto/man/ASN1_STRING_length.3 +++ b/src/lib/libcrypto/man/ASN1_STRING_length.3 | |||
@@ -1,10 +1,10 @@ | |||
1 | .\" $OpenBSD: ASN1_STRING_length.3,v 1.21 2021/10/20 13:14:00 schwarze Exp $ | 1 | .\" $OpenBSD: ASN1_STRING_length.3,v 1.22 2021/10/25 10:26:21 schwarze Exp $ |
2 | .\" full merge up to: OpenSSL 4a56d2a3 Feb 25 16:49:27 2018 +0300 | 2 | .\" full merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100 |
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) 2018, 2019 Ingo Schwarze <schwarze@openbsd.org> | 7 | .\" Copyright (c) 2018, 2019, 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 |
@@ -66,7 +66,7 @@ | |||
66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | 66 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED |
67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | 67 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. |
68 | .\" | 68 | .\" |
69 | .Dd $Mdocdate: October 20 2021 $ | 69 | .Dd $Mdocdate: October 25 2021 $ |
70 | .Dt ASN1_STRING_LENGTH 3 | 70 | .Dt ASN1_STRING_LENGTH 3 |
71 | .Os | 71 | .Os |
72 | .Sh NAME | 72 | .Sh NAME |
@@ -78,6 +78,7 @@ | |||
78 | .Nm ASN1_STRING_get0_data , | 78 | .Nm ASN1_STRING_get0_data , |
79 | .Nm ASN1_STRING_length , | 79 | .Nm ASN1_STRING_length , |
80 | .Nm ASN1_STRING_length_set , | 80 | .Nm ASN1_STRING_length_set , |
81 | .Nm ASN1_STRING_set0 , | ||
81 | .Nm ASN1_STRING_set , | 82 | .Nm ASN1_STRING_set , |
82 | .Nm ASN1_OCTET_STRING_set , | 83 | .Nm ASN1_OCTET_STRING_set , |
83 | .Nm ASN1_STRING_to_UTF8 , | 84 | .Nm ASN1_STRING_to_UTF8 , |
@@ -120,6 +121,12 @@ | |||
120 | .Fa "ASN1_STRING *x" | 121 | .Fa "ASN1_STRING *x" |
121 | .Fa "int len" | 122 | .Fa "int len" |
122 | .Fc | 123 | .Fc |
124 | .Ft void | ||
125 | .Fo ASN1_STRING_set0 | ||
126 | .Fa "ASN1_STRING *str" | ||
127 | .Fa "void *data" | ||
128 | .Fa "int len" | ||
129 | .Fc | ||
123 | .Ft int | 130 | .Ft int |
124 | .Fo ASN1_STRING_set | 131 | .Fo ASN1_STRING_set |
125 | .Fa "ASN1_STRING *str" | 132 | .Fa "ASN1_STRING *str" |
@@ -188,6 +195,15 @@ It may put | |||
188 | .Fa x | 195 | .Fa x |
189 | into an inconsistent internal state. | 196 | into an inconsistent internal state. |
190 | .Pp | 197 | .Pp |
198 | .Fn ASN1_STRING_set0 | ||
199 | frees any data stored in | ||
200 | .Fa str , | ||
201 | sets the length attribute to | ||
202 | .Fa len | ||
203 | bytes, and sets the data attribute to | ||
204 | .Fa data , | ||
205 | transferring ownership, without doing any validation. | ||
206 | .Pp | ||
191 | .Fn ASN1_STRING_set | 207 | .Fn ASN1_STRING_set |
192 | and | 208 | and |
193 | .Fn ASN1_OCTET_STRING_set | 209 | .Fn ASN1_OCTET_STRING_set |
@@ -198,7 +214,8 @@ to | |||
198 | and copy that number of bytes from | 214 | and copy that number of bytes from |
199 | .Fa data | 215 | .Fa data |
200 | into | 216 | into |
201 | .Fa str . | 217 | .Fa str , |
218 | overwriting any previous data. | ||
202 | If | 219 | If |
203 | .Fa len | 220 | .Fa len |
204 | is -1, then | 221 | is -1, then |
@@ -272,7 +289,9 @@ UTF-8 characters. | |||
272 | .Pp | 289 | .Pp |
273 | Similar care should be taken to ensure the data is in the correct format | 290 | Similar care should be taken to ensure the data is in the correct format |
274 | when calling | 291 | when calling |
275 | .Fn ASN1_STRING_set . | 292 | .Fn ASN1_STRING_set |
293 | or | ||
294 | .Fn ASN1_STRING_set0 . | ||
276 | .Sh RETURN VALUES | 295 | .Sh RETURN VALUES |
277 | .Fn ASN1_STRING_cmp | 296 | .Fn ASN1_STRING_cmp |
278 | and | 297 | and |
@@ -354,6 +373,10 @@ first appeared in OpenSSL 0.9.5 and has been available since | |||
354 | first appeared in OpenSSL 0.9.6 and has been available since | 373 | first appeared in OpenSSL 0.9.6 and has been available since |
355 | .Ox 2.9 . | 374 | .Ox 2.9 . |
356 | .Pp | 375 | .Pp |
376 | .Fn ASN1_STRING_set0 | ||
377 | first appeared in OpenSSL 0.9.8h and has been available since | ||
378 | .Ox 4.5 . | ||
379 | .Pp | ||
357 | .Fn ASN1_STRING_get0_data | 380 | .Fn ASN1_STRING_get0_data |
358 | first appeared in OpenSSL 1.1.0 and has been available since | 381 | first appeared in OpenSSL 1.1.0 and has been available since |
359 | .Ox 6.3 . | 382 | .Ox 6.3 . |