summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorschwarze <>2021-10-20 05:06:36 +0000
committerschwarze <>2021-10-20 05:06:36 +0000
commit6c0565eab2c20f5f10f838d8a8543534f08eb93e (patch)
tree48b3ed064c9a8c4f03b5b280a7569e25dc827ac9 /src/lib
parent91be46e3237cc5f325c6fe786feaf9a34c7d1e7e (diff)
downloadopenbsd-6c0565eab2c20f5f10f838d8a8543534f08eb93e.tar.gz
openbsd-6c0565eab2c20f5f10f838d8a8543534f08eb93e.tar.bz2
openbsd-6c0565eab2c20f5f10f838d8a8543534f08eb93e.zip
new manual page X509_ATTRIBUTE_get0_object(3)
documenting the four X.501 Attribute read accessors
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/Makefile3
-rw-r--r--src/lib/libcrypto/man/X509_ATTRIBUTE_get0_object.3135
-rw-r--r--src/lib/libcrypto/man/X509_ATTRIBUTE_new.33
3 files changed, 139 insertions, 2 deletions
diff --git a/src/lib/libcrypto/man/Makefile b/src/lib/libcrypto/man/Makefile
index 9c84d130c5..97c6b3e9a4 100644
--- a/src/lib/libcrypto/man/Makefile
+++ b/src/lib/libcrypto/man/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.193 2021/10/19 17:42:49 schwarze Exp $ 1# $OpenBSD: Makefile,v 1.194 2021/10/20 05:06:36 schwarze Exp $
2 2
3.include <bsd.own.mk> 3.include <bsd.own.mk>
4 4
@@ -276,6 +276,7 @@ MAN= \
276 X25519.3 \ 276 X25519.3 \
277 X509V3_get_d2i.3 \ 277 X509V3_get_d2i.3 \
278 X509_ALGOR_dup.3 \ 278 X509_ALGOR_dup.3 \
279 X509_ATTRIBUTE_get0_object.3 \
279 X509_ATTRIBUTE_new.3 \ 280 X509_ATTRIBUTE_new.3 \
280 X509_CINF_new.3 \ 281 X509_CINF_new.3 \
281 X509_CRL_get0_by_serial.3 \ 282 X509_CRL_get0_by_serial.3 \
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_get0_object.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_get0_object.3
new file mode 100644
index 0000000000..72a6557985
--- /dev/null
+++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_get0_object.3
@@ -0,0 +1,135 @@
1.\" $OpenBSD: X509_ATTRIBUTE_get0_object.3,v 1.1 2021/10/20 05:06:36 schwarze Exp $
2.\"
3.\" Copyright (c) 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\"
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
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: October 20 2021 $
18.Dt X509_ATTRIBUTE_GET0_OBJECT 3
19.Os
20.Sh NAME
21.Nm X509_ATTRIBUTE_get0_object ,
22.Nm X509_ATTRIBUTE_count ,
23.Nm X509_ATTRIBUTE_get0_type ,
24.Nm X509_ATTRIBUTE_get0_data
25.\" In the following line, "X.501" and "Attribute" are not typos.
26.\" The "Attribute" type is defined in X.501, not in X.509.
27.\" The type is called "Attribute" with capital "A", not "attribute".
28.Nd X.501 Attribute read accessors
29.Sh SYNOPSIS
30.In openssl/x509.h
31.Ft ASN1_OBJECT *
32.Fo X509_ATTRIBUTE_get0_object
33.Fa "X509_ATTRIBUTE *attr"
34.Fc
35.Ft int
36.Fo X509_ATTRIBUTE_count
37.Fa "const X509_ATTRIBUTE *attr"
38.Fc
39.Ft ASN1_TYPE *
40.Fo X509_ATTRIBUTE_get0_type
41.Fa "X509_ATTRIBUTE *attr"
42.Fa "int index"
43.Fc
44.Ft void *
45.Fo X509_ATTRIBUTE_get0_data
46.Fa "X509_ATTRIBUTE *attr"
47.Fa "int index"
48.Fa "int type"
49.Fa "void *data"
50.Fc
51.Sh DESCRIPTION
52These functions provide read access to the X.501 Attribute object
53.Fa attr .
54.Pp
55For
56.Fn X509_ATTRIBUTE_get0_data ,
57the
58.Fa type
59argument usually is one of the
60.Dv V_ASN1_*
61constants defined in
62.In openssl/asn1.h .
63For example, if a return value of the type
64.Vt ASN1_OCTET_STRING
65is expected, pass
66.Dv V_ASN1_OCTET_STRING
67as the
68.Fa type
69argument.
70The
71.Fa data
72argument is ignored; passing
73.Dv NULL
74is recommended.
75.Sh RETURN VALUES
76.Fn X509_ATTRIBUTE_get0_object
77returns an internal pointer to the type of
78.Fa attr
79or
80.Dv NULL
81if
82.Fa attr
83is
84.Dv NULL
85or if its type is not set.
86.Pp
87.Fn X509_ATTRIBUTE_count
88returns the number of values stored in
89.Fa attr
90or 0 if no value or values are set.
91.Pp
92.Fn X509_ATTRIBUTE_get0_type
93returns an internal pointer to the ASN.1 ANY object
94representing the value with the given zero-based
95.Fa index
96or
97.Dv NULL
98if
99.Fa attr
100is
101.Dv NULL ,
102if the
103.Fa index
104is larger than or equal to the number of values stored in
105.Fa attr ,
106or if no value or values are set.
107.Pp
108.Fn X509_ATTRIBUTE_get0_data
109returns an internal pointer to the data
110contained in the value with the given zero-based
111.Fa index
112or
113.Dv NULL
114if
115.Fa attr
116is
117.Dv NULL ,
118if the
119.Fa index
120is larger than or equal to the number of values stored in
121.Fa attr ,
122if no value or values are set,
123or if the ASN.1 ANY object representing the value with the given
124.Fa index
125is not of the requested
126.Fa type .
127.Sh SEE ALSO
128.Xr ASN1_OBJECT_new 3 ,
129.Xr ASN1_TYPE_new 3 ,
130.Xr OPENSSL_sk_new 3 ,
131.Xr X509_ATTRIBUTE_new 3
132.Sh HISTORY
133These functions first appeared in OpenSSL 0.9.5
134and have been available since
135.Ox 2.7 .
diff --git a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3 b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
index aa14ea2099..cd3d90e4c9 100644
--- a/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
+++ b/src/lib/libcrypto/man/X509_ATTRIBUTE_new.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.9 2021/10/20 03:31:20 schwarze Exp $ 1.\" $OpenBSD: X509_ATTRIBUTE_new.3,v 1.10 2021/10/20 05:06:36 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org> 3.\" Copyright (c) 2016, 2021 Ingo Schwarze <schwarze@openbsd.org>
4.\" 4.\"
@@ -115,6 +115,7 @@ fails on
115.Xr PKCS12_SAFEBAG_new 3 , 115.Xr PKCS12_SAFEBAG_new 3 ,
116.Xr PKCS7_add_attribute 3 , 116.Xr PKCS7_add_attribute 3 ,
117.Xr PKCS8_PRIV_KEY_INFO_new 3 , 117.Xr PKCS8_PRIV_KEY_INFO_new 3 ,
118.Xr X509_ATTRIBUTE_get0_object 3 ,
118.Xr X509_EXTENSION_new 3 , 119.Xr X509_EXTENSION_new 3 ,
119.Xr X509_new 3 , 120.Xr X509_new 3 ,
120.Xr X509_REQ_new 3 121.Xr X509_REQ_new 3