summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschwarze <>2018-02-11 20:59:30 +0000
committerschwarze <>2018-02-11 20:59:30 +0000
commit95150ccab60dc90f32fc3d09c09ba1af1ad6a112 (patch)
tree0fb8f0328fbb404349fbe10f7e03496eb5a15b26 /src
parentb79e04fbebdea85b138b8a70588f181bd8c37110 (diff)
downloadopenbsd-95150ccab60dc90f32fc3d09c09ba1af1ad6a112.tar.gz
openbsd-95150ccab60dc90f32fc3d09c09ba1af1ad6a112.tar.bz2
openbsd-95150ccab60dc90f32fc3d09c09ba1af1ad6a112.zip
Document three more functions recently made public by jsing@
as requested by jsing@, and also document six more related functions that have already been public before that. OpenSSL fails to document any of these.
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3203
1 files changed, 185 insertions, 18 deletions
diff --git a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3 b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
index b459e75863..04f38c8ec5 100644
--- a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ b/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
@@ -1,8 +1,25 @@
1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.6 2018/02/11 03:33:21 schwarze Exp $ 1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.7 2018/02/11 20:59:30 schwarze Exp $
2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500 2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500
3.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100 3.\" selective merge up to: OpenSSL 48e5119a Jan 19 10:49:22 2018 +0100
4.\" 4.\"
5.\" This file was written by Dr. Stephen Henson <steve@openssl.org> 5.\" This file is a derived work.
6.\" The changes are covered by the following Copyright and license:
7.\"
8.\" Copyright (c) 2018 Ingo Schwarze <schwarze@openbsd.org>
9.\"
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
12.\" copyright notice and this permission notice appear in all copies.
13.\"
14.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
15.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
16.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
17.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
19.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
20.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21.\"
22.\" The original file was written by Dr. Stephen Henson <steve@openssl.org>
6.\" and Viktor Dukhovni <viktor@dukhovni.org>. 23.\" and Viktor Dukhovni <viktor@dukhovni.org>.
7.\" Copyright (c) 2009, 2013, 2014, 2015, 2016, 2017 The OpenSSL Project. 24.\" Copyright (c) 2009, 2013, 2014, 2015, 2016, 2017 The OpenSSL Project.
8.\" All rights reserved. 25.\" All rights reserved.
@@ -55,6 +72,10 @@
55.Dt X509_VERIFY_PARAM_SET_FLAGS 3 72.Dt X509_VERIFY_PARAM_SET_FLAGS 3
56.Os 73.Os
57.Sh NAME 74.Sh NAME
75.Nm X509_VERIFY_PARAM_new ,
76.Nm X509_VERIFY_PARAM_free ,
77.Nm X509_VERIFY_PARAM_get0_name ,
78.Nm X509_VERIFY_PARAM_set1_name ,
58.Nm X509_VERIFY_PARAM_set_flags , 79.Nm X509_VERIFY_PARAM_set_flags ,
59.Nm X509_VERIFY_PARAM_clear_flags , 80.Nm X509_VERIFY_PARAM_clear_flags ,
60.Nm X509_VERIFY_PARAM_get_flags , 81.Nm X509_VERIFY_PARAM_get_flags ,
@@ -71,10 +92,32 @@
71.Nm X509_VERIFY_PARAM_get0_peername , 92.Nm X509_VERIFY_PARAM_get0_peername ,
72.Nm X509_VERIFY_PARAM_set1_email , 93.Nm X509_VERIFY_PARAM_set1_email ,
73.Nm X509_VERIFY_PARAM_set1_ip , 94.Nm X509_VERIFY_PARAM_set1_ip ,
74.Nm X509_VERIFY_PARAM_set1_ip_asc 95.Nm X509_VERIFY_PARAM_set1_ip_asc ,
96.Nm X509_VERIFY_PARAM_add0_table ,
97.Nm X509_VERIFY_PARAM_lookup ,
98.Nm X509_VERIFY_PARAM_get_count ,
99.Nm X509_VERIFY_PARAM_get0 ,
100.Nm X509_VERIFY_PARAM_table_cleanup
75.Nd X509 verification parameters 101.Nd X509 verification parameters
76.Sh SYNOPSIS 102.Sh SYNOPSIS
77.In openssl/x509_vfy.h 103.In openssl/x509_vfy.h
104.Ft X509_VERIFY_PARAM *
105.Fo X509_VERIFY_PARAM_new
106.Fa void
107.Fc
108.Ft void
109.Fo X509_VERIFY_PARAM_free
110.Fa "X509_VERIFY_PARAM *param"
111.Fc
112.Ft const char *
113.Fo X509_VERIFY_PARAM_get0_name
114.Fa "const X509_VERIFY_PARAM *param"
115.Fc
116.Ft int
117.Fo X509_VERIFY_PARAM_set1_name
118.Fa "X509_VERIFY_PARAM *param"
119.Fa "const char *name"
120.Fc
78.Ft int 121.Ft int
79.Fo X509_VERIFY_PARAM_set_flags 122.Fo X509_VERIFY_PARAM_set_flags
80.Fa "X509_VERIFY_PARAM *param" 123.Fa "X509_VERIFY_PARAM *param"
@@ -161,14 +204,77 @@
161.Fa "X509_VERIFY_PARAM *param" 204.Fa "X509_VERIFY_PARAM *param"
162.Fa "const char *ipasc" 205.Fa "const char *ipasc"
163.Fc 206.Fc
207.Ft int
208.Fo X509_VERIFY_PARAM_add0_table
209.Fa "X509_VERIFY_PARAM *param"
210.Fc
211.Ft const X509_VERIFY_PARAM *
212.Fo X509_VERIFY_PARAM_lookup
213.Fa "const char *name"
214.Fc
215.Ft int
216.Fo X509_VERIFY_PARAM_get_count
217.Fa void
218.Fc
219.Ft const X509_VERIFY_PARAM *
220.Fo X509_VERIFY_PARAM_get0
221.Fa "int id"
222.Fc
223.Ft void
224.Fo X509_VERIFY_PARAM_table_cleanup
225.Fa void
226.Fc
164.Sh DESCRIPTION 227.Sh DESCRIPTION
165These functions manipulate the 228These functions manipulate an
166.Vt X509_VERIFY_PARAM 229.Vt X509_VERIFY_PARAM
167structure associated with a certificate verification operation. 230object associated with a certificate verification operation.
231.Pp
232.Fn X509_VERIFY_PARAM_new
233allocates and initializes an empty
234.Vt X509_VERIFY_PARAM
235object.
236.Pp
237.Fn X509_VERIFY_PARAM_free
238clears all data contained in
239.Fa param
240and releases all memory used by it.
241If
242.Fa param
243is a
244.Dv NULL
245pointer, no action occurs.
246.Pp
247.Fn X509_VERIFY_PARAM_get0_name
248returns the name of the given
249.Fa param
250object, usually describing its purpose, for example
251.Qq default ,
252.Qq pkcs7 ,
253.Qq smime_sign ,
254.Qq ssl_client ,
255or
256.Qq ssl_server .
257For user-defined objects, the returned pointer may be
258.Dv NULL
259even if the object is otherwise valid.
260.Pp
261.Fn X509_VERIFY_PARAM_set1_name
262sets the name of
263.Fa param
264to a copy of
265.Fa name ,
266or to
267.Dv NULL
268if
269.Fa name
270is
271.Dv NULL .
272This function is quite dangerous because it invalidates pointers
273previously returned from
274.Fn X509_VERIFY_PARAM_get0_name .
168.Pp 275.Pp
169The
170.Fn X509_VERIFY_PARAM_set_flags 276.Fn X509_VERIFY_PARAM_set_flags
171function sets the flags in 277sets the flags in
172.Fa param 278.Fa param
173by OR'ing it with 279by OR'ing it with
174.Fa flags . 280.Fa flags .
@@ -283,11 +389,6 @@ When wildcard matching is not disabled, or when a reference identifier
283specifies a parent domain (starts with ".") rather than a hostname, the 389specifies a parent domain (starts with ".") rather than a hostname, the
284peer name may be a wildcard name or a sub-domain of the reference 390peer name may be a wildcard name or a sub-domain of the reference
285identifier respectively. 391identifier respectively.
286The return string is allocated by the library and is no longer valid
287once the associated
288.Fa param
289argument is freed.
290Applications must not free the return value.
291.Pp 392.Pp
292.Fn X509_VERIFY_PARAM_set1_email 393.Fn X509_VERIFY_PARAM_set1_email
293sets the expected RFC822 email address to 394sets the expected RFC822 email address to
@@ -324,7 +425,54 @@ The
324argument is a NUL-terminal ASCII string: 425argument is a NUL-terminal ASCII string:
325dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6. 426dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6.
326The condensed "::" notation is supported for IPv6 addresses. 427The condensed "::" notation is supported for IPv6 addresses.
428.Pp
429.Fn X509_VERIFY_PARAM_add0_table
430adds
431.Fa param
432to a static list of
433.Vt X509_VERIFY_PARAM
434objects maintained by the library.
435This function is extremely dangerous because contrary to the name
436of the function, if the list already contains an object that happens
437to have the same name, that old object is not only silently removed
438from the list, but also silently freed, which may silently invalidate
439various pointers existing elsewhere in the program.
440.Pp
441.Fn X509_VERIFY_PARAM_lookup
442searches this list for an object of the given
443.Fa name .
444If no match is found, the predefined objects built-in to the library
445are also inspected.
446.Pp
447.Fn X509_VERIFY_PARAM_get_count
448returns the sum of the number of objects on this list and the number
449of predefined objects built-in to the library.
450Note that this is not necessarily the total number of
451.Vt X509_VERIFY_PARAM
452objects existing in the program because there may be additional such
453objects that were never added to the list.
454.Pp
455.Fn X509_VERIFY_PARAM_get0
456accesses predefined and user-defined objects using
457.Fa id
458as an index, useful for looping over objects without knowing their names.
459An argument less than the number of predefined objects selects
460one of the predefined objects; a higher argument selects an object
461from the list.
462.Pp
463.Fn X509_VERIFY_PARAM_table_cleanup
464deletes all objects from this list.
465It is extremely dangerous because it also invalidates all data that
466was contained in all objects that were on the list and because it
467frees all these objects, which may invalidate various pointers
468existing elsewhere in the program.
327.Sh RETURN VALUES 469.Sh RETURN VALUES
470.Fn X509_VERIFY_PARAM_new
471returns a pointer to the new object, or
472.Dv NULL
473on allocation failure.
474.Pp
475.Fn X509_VERIFY_PARAM_set1_name ,
328.Fn X509_VERIFY_PARAM_set_flags , 476.Fn X509_VERIFY_PARAM_set_flags ,
329.Fn X509_VERIFY_PARAM_clear_flags , 477.Fn X509_VERIFY_PARAM_clear_flags ,
330.Fn X509_VERIFY_PARAM_set_purpose , 478.Fn X509_VERIFY_PARAM_set_purpose ,
@@ -335,20 +483,39 @@ The condensed "::" notation is supported for IPv6 addresses.
335.Fn X509_VERIFY_PARAM_add1_host , 483.Fn X509_VERIFY_PARAM_add1_host ,
336.Fn X509_VERIFY_PARAM_set1_email , 484.Fn X509_VERIFY_PARAM_set1_email ,
337.Fn X509_VERIFY_PARAM_set1_ip , 485.Fn X509_VERIFY_PARAM_set1_ip ,
486.Fn X509_VERIFY_PARAM_set1_ip_asc ,
338and 487and
339.Fn X509_VERIFY_PARAM_set1_ip_asc 488.Fn X509_VERIFY_PARAM_add0_table
340return 1 for success or 0 for failure. 489return 1 for success or 0 for failure.
341.Pp 490.Pp
342.Fn X509_VERIFY_PARAM_get_flags 491.Fn X509_VERIFY_PARAM_get_flags
343returns the current verification flags. 492returns the current verification flags.
344.Pp 493.Pp
345.Fn X509_VERIFY_PARAM_set_time
346and
347.Fn X509_VERIFY_PARAM_set_depth
348do not return values.
349.Pp
350.Fn X509_VERIFY_PARAM_get_depth 494.Fn X509_VERIFY_PARAM_get_depth
351returns the current verification depth. 495returns the current verification depth.
496.Pp
497.Fn X509_VERIFY_PARAM_get0_name
498and
499.Fn X509_VERIFY_PARAM_get0_peername
500return pointers to strings that are only valid
501during the lifetime of the given
502.Fa param
503object and that must not be freed by the application program.
504.Pp
505.Fn X509_VERIFY_PARAM_lookup
506and
507.Fn X509_VERIFY_PARAM_get0
508return a pointer to an existing built-in or user-defined object, or
509.Dv NULL
510if no object with the given
511.Fa name
512is found, or if
513.Fa id
514is at least
515.Fn X509_VERIFY_PARAM_get_count .
516.Pp
517.Fn X509_VERIFY_PARAM_get_count
518returns a number of objects.
352.Sh VERIFICATION FLAGS 519.Sh VERIFICATION FLAGS
353The verification flags consists of zero or more of the following 520The verification flags consists of zero or more of the following
354flags OR'ed together. 521flags OR'ed together.