summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2021-10-25 10:26:21 +0000
committerschwarze <>2021-10-25 10:26:21 +0000
commit0e1dfee67fce5df9c6b4694351bc4fba5e38a19e (patch)
tree5002aee60966ff771e06b18f7f974127e47e663a
parente3f2ec519b25cefd4a104b2b27e0831a9b500067 (diff)
downloadopenbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.tar.gz
openbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.tar.bz2
openbsd-0e1dfee67fce5df9c6b4694351bc4fba5e38a19e.zip
document ASN1_STRING_set0(3)
-rw-r--r--src/lib/libcrypto/man/ASN1_STRING_length.335
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
189into an inconsistent internal state. 196into an inconsistent internal state.
190.Pp 197.Pp
198.Fn ASN1_STRING_set0
199frees any data stored in
200.Fa str ,
201sets the length attribute to
202.Fa len
203bytes, and sets the data attribute to
204.Fa data ,
205transferring ownership, without doing any validation.
206.Pp
191.Fn ASN1_STRING_set 207.Fn ASN1_STRING_set
192and 208and
193.Fn ASN1_OCTET_STRING_set 209.Fn ASN1_OCTET_STRING_set
@@ -198,7 +214,8 @@ to
198and copy that number of bytes from 214and copy that number of bytes from
199.Fa data 215.Fa data
200into 216into
201.Fa str . 217.Fa str ,
218overwriting any previous data.
202If 219If
203.Fa len 220.Fa len
204is -1, then 221is -1, then
@@ -272,7 +289,9 @@ UTF-8 characters.
272.Pp 289.Pp
273Similar care should be taken to ensure the data is in the correct format 290Similar care should be taken to ensure the data is in the correct format
274when calling 291when calling
275.Fn ASN1_STRING_set . 292.Fn ASN1_STRING_set
293or
294.Fn ASN1_STRING_set0 .
276.Sh RETURN VALUES 295.Sh RETURN VALUES
277.Fn ASN1_STRING_cmp 296.Fn ASN1_STRING_cmp
278and 297and
@@ -354,6 +373,10 @@ first appeared in OpenSSL 0.9.5 and has been available since
354first appeared in OpenSSL 0.9.6 and has been available since 373first 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
377first 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
358first appeared in OpenSSL 1.1.0 and has been available since 381first appeared in OpenSSL 1.1.0 and has been available since
359.Ox 6.3 . 382.Ox 6.3 .