diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/man/X509_NAME_ENTRY_get_object.3 | 86 |
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 |
139 | An X.501 | 144 | An X.501 |
140 | .Vt RelativeDistinguishedName | 145 | .Vt RelativeDistinguishedName |
141 | is a set of field type and value pairs. | 146 | is an ordered set of field type and value pairs. |
142 | It is the building block for constructing X.501 | 147 | It is the building block for constructing X.501 |
143 | .Vt Name | 148 | .Vt Name |
144 | objects. | 149 | objects. |
145 | This implementation only supports sets with one element, so an | 150 | The |
151 | .Vt X509_NAME_ENTRY | ||
152 | object stores one such pair, containing one field type and one value. | ||
153 | .Pp | ||
154 | .Vt X509_NAME_ENTRY | ||
155 | objects are intended for use by the | ||
156 | .Vt X509_NAME | ||
157 | objects documented in | ||
158 | .Xr X509_NAME_new 3 . | ||
159 | Since part of the information about how several | ||
160 | .Vt X509_NAME_ENTRY | ||
161 | objects combine to form an X.501 | ||
162 | .Vt Name | ||
163 | is stored in the individual | ||
164 | .Vt X509_NAME_ENTRY | ||
165 | objects rather than in the | ||
166 | .Vt X509_NAME | ||
167 | object, any given | ||
146 | .Vt X509_NAME_ENTRY | 168 | .Vt X509_NAME_ENTRY |
147 | object contains only one field type and one value. | 169 | object can only be used by one |
170 | .Vt X509_NAME | ||
171 | object at a time. | ||
148 | .Pp | 172 | .Pp |
149 | .Fn X509_NAME_ENTRY_new | 173 | .Fn X509_NAME_ENTRY_new |
150 | allocates and initializes an empty | 174 | allocates and initializes an empty |
151 | .Vt X509_NAME_ENTRY | 175 | .Vt X509_NAME_ENTRY |
152 | object, representing an ASN.1 | 176 | object, representing an ASN.1 |
153 | .Vt RelativeDistinguishedName | 177 | .Vt RelativeDistinguishedName |
154 | structure defined in RFC 5280 section 4.1.2.4. | 178 | structure defined in RFC 5280 section 4.1.2.4, but containing not more |
179 | than one type-value-pair. | ||
155 | .Pp | 180 | .Pp |
156 | .Fn X509_NAME_ENTRY_free | 181 | .Fn X509_NAME_ENTRY_free |
157 | frees | 182 | frees |
@@ -175,6 +200,29 @@ These two functions can be used to examine an | |||
175 | object as returned by | 200 | object 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 | ||
204 | retrieves the index of the X.501 | ||
205 | .Vt RelativeDistinguishedName Pq RDN | ||
206 | that | ||
207 | .Fa ne | ||
208 | is part of in the X.501 | ||
209 | .Vt Name | ||
210 | object using it. | ||
211 | The first RDN has index 0. | ||
212 | If an RDN consists of more than one | ||
213 | .Vt X509_NAME_ENTRY | ||
214 | object, they all share the same index. | ||
215 | In practice, RDNs containing more than one type-value-pair are rarely | ||
216 | used, so if an | ||
217 | .Va X509_NAME *name | ||
218 | object uses | ||
219 | .Fa ne , | ||
220 | then | ||
221 | .Fn X509_NAME_ENTRY_set ne | ||
222 | usually agrees with | ||
223 | .Fn sk_X509_NAME_ENTRY_find name->entries ne , | ||
224 | but 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 |
179 | sets the field type of | 227 | sets 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 |
247 | if an error occurred. | 295 | if an error occurred. |
248 | .Pp | 296 | .Pp |
297 | .Fn X509_NAME_ENTRY_set | ||
298 | returns the zero-based index of the RDN | ||
299 | .Fa ne | ||
300 | is used in, or 0 if | ||
301 | .Fa ne | ||
302 | is not yet used by any | ||
303 | .Vt X509_NAME | ||
304 | object. | ||
305 | .Pp | ||
249 | The | 306 | The |
250 | .Fn X509_NAME_ENTRY_set_object | 307 | .Fn X509_NAME_ENTRY_set_object |
251 | function returns 1 if successful; | 308 | function 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 |
256 | return 1 on success or 0 on error. | 313 | returns 1 on success or 0 on error. |
257 | In some cases of failure, the reason can be determined with | 314 | In 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 |
300 | first appeared in OpenSSL 0.9.5 and has been available since | 357 | first 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 | ||
361 | first appeared in OpenSSL 1.1.0 and has been available since | ||
362 | .Ox 6.3 . | ||
363 | .Sh CAVEATS | ||
364 | Despite its name, | ||
365 | .Fn X509_NAME_ENTRY_set | ||
366 | does not set anything. | ||
367 | Something like | ||
368 | .Dq X509_NAME_ENTRY_get_set | ||
369 | would have been a better name. | ||