summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2021-07-02 16:13:56 +0000
committerschwarze <>2021-07-02 16:13:56 +0000
commit39519255813e676fc5e573ad0f2748e54f95c4ca (patch)
tree1efc491dab777ff86f8585babca5d83a8bfddc29 /src
parent771daaf25c9b7bc73b4c9d13dd9dee03d0ea4f69 (diff)
downloadopenbsd-39519255813e676fc5e573ad0f2748e54f95c4ca.tar.gz
openbsd-39519255813e676fc5e573ad0f2748e54f95c4ca.tar.bz2
openbsd-39519255813e676fc5e573ad0f2748e54f95c4ca.zip
Document the read-only (sic!) accessor function X509_NAME_ENTRY_set(3).
While here, stress that X509_NAME objects cannot share X509_NAME_ENTRY objects, and polish a few misleading wordings.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.386
1 files changed, 77 insertions, 9 deletions
diff --git a/src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 b/src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
index aab40c2aa5..7437ee82c1 100644
--- a/src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
+++ b/src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3
@@ -1,11 +1,11 @@
1.\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.13 2019/06/14 13:59:32 schwarze Exp $ 1.\" $OpenBSD: X509_NAME_ENTRY_get_object.3,v 1.14 2021/07/02 16:13:56 schwarze Exp $
2.\" full merge up to: OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400 2.\" full merge up to: OpenSSL aebb9aac Jul 19 09:27:53 2016 -0400
3.\" selective merge up to: OpenSSL 61f805c1 Jan 16 01:01:46 2018 +0800 3.\" selective merge up to: OpenSSL ca34e08d Dec 12 07:38:07 2018 +0100
4.\" 4.\"
5.\" This file is a derived work. 5.\" This file is a derived work.
6.\" The changes are covered by the following Copyright and license: 6.\" The changes are covered by the following Copyright and license:
7.\" 7.\"
8.\" Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org> 8.\" Copyright (c) 2016, 2018, 2019, 2021 Ingo Schwarze <schwarze@openbsd.org>
9.\" 9.\"
10.\" Permission to use, copy, modify, and distribute this software for any 10.\" Permission to use, copy, modify, and distribute this software for any
11.\" purpose with or without fee is hereby granted, provided that the above 11.\" purpose with or without fee is hereby granted, provided that the above
@@ -67,7 +67,7 @@
67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 67.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
68.\" OF THE POSSIBILITY OF SUCH DAMAGE. 68.\" OF THE POSSIBILITY OF SUCH DAMAGE.
69.\" 69.\"
70.Dd $Mdocdate: June 14 2019 $ 70.Dd $Mdocdate: July 2 2021 $
71.Dt X509_NAME_ENTRY_GET_OBJECT 3 71.Dt X509_NAME_ENTRY_GET_OBJECT 3
72.Os 72.Os
73.Sh NAME 73.Sh NAME
@@ -75,6 +75,7 @@
75.Nm X509_NAME_ENTRY_free , 75.Nm X509_NAME_ENTRY_free ,
76.Nm X509_NAME_ENTRY_get_object , 76.Nm X509_NAME_ENTRY_get_object ,
77.Nm X509_NAME_ENTRY_get_data , 77.Nm X509_NAME_ENTRY_get_data ,
78.Nm X509_NAME_ENTRY_set ,
78.Nm X509_NAME_ENTRY_set_object , 79.Nm X509_NAME_ENTRY_set_object ,
79.Nm X509_NAME_ENTRY_set_data , 80.Nm X509_NAME_ENTRY_set_data ,
80.Nm X509_NAME_ENTRY_create_by_txt , 81.Nm X509_NAME_ENTRY_create_by_txt ,
@@ -100,6 +101,10 @@
100.Fa "const X509_NAME_ENTRY *ne" 101.Fa "const X509_NAME_ENTRY *ne"
101.Fc 102.Fc
102.Ft int 103.Ft int
104.Fo X509_NAME_ENTRY_set
105.Fa "const X509_NAME_ENTRY *ne"
106.Fc
107.Ft int
103.Fo X509_NAME_ENTRY_set_object 108.Fo X509_NAME_ENTRY_set_object
104.Fa "X509_NAME_ENTRY *ne" 109.Fa "X509_NAME_ENTRY *ne"
105.Fa "const ASN1_OBJECT *obj" 110.Fa "const ASN1_OBJECT *obj"
@@ -138,20 +143,40 @@
138.Sh DESCRIPTION 143.Sh DESCRIPTION
139An X.501 144An X.501
140.Vt RelativeDistinguishedName 145.Vt RelativeDistinguishedName
141is a set of field type and value pairs. 146is an ordered set of field type and value pairs.
142It is the building block for constructing X.501 147It is the building block for constructing X.501
143.Vt Name 148.Vt Name
144objects. 149objects.
145This implementation only supports sets with one element, so an 150The
151.Vt X509_NAME_ENTRY
152object stores one such pair, containing one field type and one value.
153.Pp
154.Vt X509_NAME_ENTRY
155objects are intended for use by the
156.Vt X509_NAME
157objects documented in
158.Xr X509_NAME_new 3 .
159Since part of the information about how several
160.Vt X509_NAME_ENTRY
161objects combine to form an X.501
162.Vt Name
163is stored in the individual
164.Vt X509_NAME_ENTRY
165objects rather than in the
166.Vt X509_NAME
167object, any given
146.Vt X509_NAME_ENTRY 168.Vt X509_NAME_ENTRY
147object contains only one field type and one value. 169object can only be used by one
170.Vt X509_NAME
171object at a time.
148.Pp 172.Pp
149.Fn X509_NAME_ENTRY_new 173.Fn X509_NAME_ENTRY_new
150allocates and initializes an empty 174allocates and initializes an empty
151.Vt X509_NAME_ENTRY 175.Vt X509_NAME_ENTRY
152object, representing an ASN.1 176object, representing an ASN.1
153.Vt RelativeDistinguishedName 177.Vt RelativeDistinguishedName
154structure defined in RFC 5280 section 4.1.2.4. 178structure defined in RFC 5280 section 4.1.2.4, but containing not more
179than one type-value-pair.
155.Pp 180.Pp
156.Fn X509_NAME_ENTRY_free 181.Fn X509_NAME_ENTRY_free
157frees 182frees
@@ -175,6 +200,29 @@ These two functions can be used to examine an
175object as returned by 200object as returned by
176.Xr X509_NAME_get_entry 3 . 201.Xr X509_NAME_get_entry 3 .
177.Pp 202.Pp
203.Fn X509_NAME_ENTRY_set
204retrieves the index of the X.501
205.Vt RelativeDistinguishedName Pq RDN
206that
207.Fa ne
208is part of in the X.501
209.Vt Name
210object using it.
211The first RDN has index 0.
212If an RDN consists of more than one
213.Vt X509_NAME_ENTRY
214object, they all share the same index.
215In practice, RDNs containing more than one type-value-pair are rarely
216used, so if an
217.Va X509_NAME *name
218object uses
219.Fa ne ,
220then
221.Fn X509_NAME_ENTRY_set ne
222usually agrees with
223.Fn sk_X509_NAME_ENTRY_find name->entries ne ,
224but when multi-pair RDNs are used, it may be smaller.
225.Pp
178.Fn X509_NAME_ENTRY_set_object 226.Fn X509_NAME_ENTRY_set_object
179sets the field type of 227sets the field type of
180.Fa ne 228.Fa ne
@@ -246,6 +294,15 @@ structure if it is set or
246.Dv NULL 294.Dv NULL
247if an error occurred. 295if an error occurred.
248.Pp 296.Pp
297.Fn X509_NAME_ENTRY_set
298returns the zero-based index of the RDN
299.Fa ne
300is used in, or 0 if
301.Fa ne
302is not yet used by any
303.Vt X509_NAME
304object.
305.Pp
249The 306The
250.Fn X509_NAME_ENTRY_set_object 307.Fn X509_NAME_ENTRY_set_object
251function returns 1 if successful; 308function returns 1 if successful;
@@ -253,7 +310,7 @@ otherwise 0 is returned and an error code can be retrieved with
253.Xr ERR_get_error 3 . 310.Xr ERR_get_error 3 .
254.Pp 311.Pp
255.Fn X509_NAME_ENTRY_set_data 312.Fn X509_NAME_ENTRY_set_data
256return 1 on success or 0 on error. 313returns 1 on success or 0 on error.
257In some cases of failure, the reason can be determined with 314In some cases of failure, the reason can be determined with
258.Xr ERR_get_error 3 . 315.Xr ERR_get_error 3 .
259.Pp 316.Pp
@@ -299,3 +356,14 @@ These functions have been available since
299.Fn X509_NAME_ENTRY_create_by_txt 356.Fn X509_NAME_ENTRY_create_by_txt
300first appeared in OpenSSL 0.9.5 and has been available since 357first appeared in OpenSSL 0.9.5 and has been available since
301.Ox 2.7 . 358.Ox 2.7 .
359.Pp
360.Fn X509_NAME_ENTRY_set
361first appeared in OpenSSL 1.1.0 and has been available since
362.Ox 6.3 .
363.Sh CAVEATS
364Despite its name,
365.Fn X509_NAME_ENTRY_set
366does not set anything.
367Something like
368.Dq X509_NAME_ENTRY_get_set
369would have been a better name.