summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man')
-rw-r--r--src/lib/libcrypto/man/X509_ATTRIBUTE_new.366
1 files changed, 60 insertions, 6 deletions
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
index 66779d637b..aa14ea2099 100644
--- a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
+++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
@@ -1,6 +1,6 @@
1.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.8 2020/06/04 10:24:27 schwarze Exp $ 1.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.9 2021/10/20 03:31:20 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
5.\" Permission to use, copy, modify, and distribute this software for any 5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above 6.\" purpose with or without fee is hereby granted, provided that the above
@@ -14,20 +14,26 @@
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: June 4 2020 $ 17.Dd $Mdocdate: October 20 2021 $
18.Dt X509_ATTRIBUTE_NEW 3 18.Dt X509_ATTRIBUTE_NEW 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
21.Nm X509_ATTRIBUTE_new , 21.Nm X509_ATTRIBUTE_new ,
22.Nm X509_ATTRIBUTE_create ,
23.Nm X509_ATTRIBUTE_dup ,
22.Nm X509_ATTRIBUTE_free 24.Nm X509_ATTRIBUTE_free
23.\" In the following line, "X.501" and "Attribute" are not typos. 25.\" In the following line, "X.501" and "Attribute" are not typos.
24.\" The "Attribute" type is defined in X.501, not in X.509. 26.\" The "Attribute" type is defined in X.501, not in X.509.
25.\" The type in called "Attribute" with capital "A", not "attribute". 27.\" The type is called "Attribute" with capital "A", not "attribute".
26.Nd generic X.501 Attribute 28.Nd generic X.501 Attribute
27.Sh SYNOPSIS 29.Sh SYNOPSIS
28.In openssl/x509.h 30.In openssl/x509.h
29.Ft X509_ATTRIBUTE * 31.Ft X509_ATTRIBUTE *
30.Fn X509_ATTRIBUTE_new void 32.Fn X509_ATTRIBUTE_new void
33.Ft X509_ATTRIBUTE *
34.Fn X509_ATTRIBUTE_create "int nid" "int type" "void *value"
35.Ft X509_ATTRIBUTE *
36.Fn X509_ATTRIBUTE_dup "X509_ATTRIBUTE *attr"
31.Ft void 37.Ft void
32.Fn X509_ATTRIBUTE_free "X509_ATTRIBUTE *attr" 38.Fn X509_ATTRIBUTE_free "X509_ATTRIBUTE *attr"
33.Sh DESCRIPTION 39.Sh DESCRIPTION
@@ -52,18 +58,60 @@ container object described in
52allocates and initializes an empty 58allocates and initializes an empty
53.Vt X509_ATTRIBUTE 59.Vt X509_ATTRIBUTE
54object. 60object.
61.Pp
62.Fn X509_ATTRIBUTE_create
63allocates a new multi-valued
64.Vt X509_ATTRIBUTE
65object of the type
66.Fa nid
67and initializes its set of values
68to contain one new ASN.1 ANY object with the given
69.Fa value
70and
71.Fa type .
72The
73.Fa type
74usually is one of the
75.Dv V_ASN1_*
76constants defined in
77.In openssl/asn1.h ;
78it is stored without validating it.
79If the function succeeds, ownership of the
80.Fa value
81is transferred to the new
82.Vt X509_ATTRIBUTE
83object.
84.Pp
85Be careful to not confuse the type of the attribute
86and the type of the value.
87.Pp
88.Fn X509_ATTRIBUTE_dup
89creates a deep copy of
90.Fa attr .
91.Pp
55.Fn X509_ATTRIBUTE_free 92.Fn X509_ATTRIBUTE_free
56frees 93frees
57.Fa attr . 94.Fa attr .
58.Sh RETURN VALUES 95.Sh RETURN VALUES
59.Fn X509_ATTRIBUTE_new 96.Fn X509_ATTRIBUTE_new ,
60returns the new 97.Fn X509_ATTRIBUTE_create ,
98and
99.Fn X509_ATTRIBUTE_dup
100return the new
61.Vt X509_ATTRIBUTE 101.Vt X509_ATTRIBUTE
62object or 102object or
63.Dv NULL 103.Dv NULL
64if an error occurs. 104if an error occurs.
105.Pp
106In particular, these functions fail if memory allocation fails.
107.Fn X509_ATTRIBUTE_create
108also fails if
109.Xr OBJ_nid2obj 3
110fails on
111.Fa nid .
65.Sh SEE ALSO 112.Sh SEE ALSO
66.Xr d2i_X509_ATTRIBUTE 3 , 113.Xr d2i_X509_ATTRIBUTE 3 ,
114.Xr OBJ_nid2obj 3 ,
67.Xr PKCS12_SAFEBAG_new 3 , 115.Xr PKCS12_SAFEBAG_new 3 ,
68.Xr PKCS7_add_attribute 3 , 116.Xr PKCS7_add_attribute 3 ,
69.Xr PKCS8_PRIV_KEY_INFO_new 3 , 117.Xr PKCS8_PRIV_KEY_INFO_new 3 ,
@@ -96,6 +144,12 @@ and
96.Fn X509_ATTRIBUTE_free 144.Fn X509_ATTRIBUTE_free
97first appeared in SSLeay 0.5.1 and have been available since 145first appeared in SSLeay 0.5.1 and have been available since
98.Ox 2.4 . 146.Ox 2.4 .
147.Pp
148.Fn X509_ATTRIBUTE_create
149and
150.Fn X509_ATTRIBUTE_dup
151first appeared in SSLeay 0.9.1 and have been available since
152.Ox 2.6 .
99.Sh BUGS 153.Sh BUGS
100A data type designed to hold arbitrary data is an oxymoron. 154A data type designed to hold arbitrary data is an oxymoron.
101.Pp 155.Pp