summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3')
-rw-r--r--src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3756
1 files changed, 0 insertions, 756 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
deleted file mode 100644
index ea3c867b8b..0000000000
--- a/src/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
+++ /dev/null
@@ -1,756 +0,0 @@
1.\" $OpenBSD: X509_VERIFY_PARAM_set_flags.3,v 1.17 2021/07/23 16:43:56 schwarze Exp $
2.\" full merge up to: OpenSSL d33def66 Feb 9 14:17:13 2016 -0500
3.\" selective merge up to: OpenSSL 24a535ea Sep 22 13:14:20 2020 +0100
4.\"
5.\" This file is a derived work.
6.\" The changes are covered by the following Copyright and license:
7.\"
8.\" Copyright (c) 2018, 2021 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>
23.\" and Viktor Dukhovni <viktor@dukhovni.org>.
24.\" Copyright (c) 2009, 2013, 2014, 2015, 2016, 2017 The OpenSSL Project.
25.\" All rights reserved.
26.\"
27.\" Redistribution and use in source and binary forms, with or without
28.\" modification, are permitted provided that the following conditions
29.\" are met:
30.\"
31.\" 1. Redistributions of source code must retain the above copyright
32.\" notice, this list of conditions and the following disclaimer.
33.\"
34.\" 2. Redistributions in binary form must reproduce the above copyright
35.\" notice, this list of conditions and the following disclaimer in
36.\" the documentation and/or other materials provided with the
37.\" distribution.
38.\"
39.\" 3. All advertising materials mentioning features or use of this
40.\" software must display the following acknowledgment:
41.\" "This product includes software developed by the OpenSSL Project
42.\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
43.\"
44.\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
45.\" endorse or promote products derived from this software without
46.\" prior written permission. For written permission, please contact
47.\" openssl-core@openssl.org.
48.\"
49.\" 5. Products derived from this software may not be called "OpenSSL"
50.\" nor may "OpenSSL" appear in their names without prior written
51.\" permission of the OpenSSL Project.
52.\"
53.\" 6. Redistributions of any form whatsoever must retain the following
54.\" acknowledgment:
55.\" "This product includes software developed by the OpenSSL Project
56.\" for use in the OpenSSL Toolkit (http://www.openssl.org/)"
57.\"
58.\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
59.\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
60.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
61.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
62.\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
63.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
64.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
65.\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
67.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
68.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
69.\" OF THE POSSIBILITY OF SUCH DAMAGE.
70.\"
71.Dd $Mdocdate: July 23 2021 $
72.Dt X509_VERIFY_PARAM_SET_FLAGS 3
73.Os
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 ,
79.Nm X509_VERIFY_PARAM_set_flags ,
80.Nm X509_VERIFY_PARAM_clear_flags ,
81.Nm X509_VERIFY_PARAM_get_flags ,
82.Nm X509_VERIFY_PARAM_set_purpose ,
83.Nm X509_VERIFY_PARAM_set_trust ,
84.Nm X509_VERIFY_PARAM_set_time ,
85.Nm X509_VERIFY_PARAM_add0_policy ,
86.Nm X509_VERIFY_PARAM_set1_policies ,
87.Nm X509_VERIFY_PARAM_set_depth ,
88.Nm X509_VERIFY_PARAM_get_depth ,
89.Nm X509_VERIFY_PARAM_set1_host ,
90.Nm X509_VERIFY_PARAM_add1_host ,
91.Nm X509_VERIFY_PARAM_set_hostflags ,
92.Nm X509_VERIFY_PARAM_get0_peername ,
93.Nm X509_VERIFY_PARAM_set1_email ,
94.Nm X509_VERIFY_PARAM_set1_ip ,
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
101.Nd X509 verification parameters
102.Sh SYNOPSIS
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
121.Ft int
122.Fo X509_VERIFY_PARAM_set_flags
123.Fa "X509_VERIFY_PARAM *param"
124.Fa "unsigned long flags"
125.Fc
126.Ft int
127.Fo X509_VERIFY_PARAM_clear_flags
128.Fa "X509_VERIFY_PARAM *param"
129.Fa "unsigned long flags"
130.Fc
131.Ft unsigned long
132.Fo X509_VERIFY_PARAM_get_flags
133.Fa "X509_VERIFY_PARAM *param"
134.Fc
135.Ft int
136.Fo X509_VERIFY_PARAM_set_purpose
137.Fa "X509_VERIFY_PARAM *param"
138.Fa "int purpose"
139.Fc
140.Ft int
141.Fo X509_VERIFY_PARAM_set_trust
142.Fa "X509_VERIFY_PARAM *param"
143.Fa "int trust"
144.Fc
145.Ft void
146.Fo X509_VERIFY_PARAM_set_time
147.Fa "X509_VERIFY_PARAM *param"
148.Fa "time_t t"
149.Fc
150.Ft int
151.Fo X509_VERIFY_PARAM_add0_policy
152.Fa "X509_VERIFY_PARAM *param"
153.Fa "ASN1_OBJECT *policy"
154.Fc
155.Ft int
156.Fo X509_VERIFY_PARAM_set1_policies
157.Fa "X509_VERIFY_PARAM *param"
158.Fa "STACK_OF(ASN1_OBJECT) *policies"
159.Fc
160.Ft void
161.Fo X509_VERIFY_PARAM_set_depth
162.Fa "X509_VERIFY_PARAM *param"
163.Fa "int depth"
164.Fc
165.Ft int
166.Fo X509_VERIFY_PARAM_get_depth
167.Fa "const X509_VERIFY_PARAM *param"
168.Fc
169.Ft int
170.Fo X509_VERIFY_PARAM_set1_host
171.Fa "X509_VERIFY_PARAM *param"
172.Fa "const char *name"
173.Fa "size_t namelen"
174.Fc
175.Ft int
176.Fo X509_VERIFY_PARAM_add1_host
177.Fa "X509_VERIFY_PARAM *param"
178.Fa "const char *name"
179.Fa "size_t namelen"
180.Fc
181.Ft void
182.Fo X509_VERIFY_PARAM_set_hostflags
183.Fa "X509_VERIFY_PARAM *param"
184.Fa "unsigned int flags"
185.Fc
186.Ft char *
187.Fo X509_VERIFY_PARAM_get0_peername
188.Fa "X509_VERIFY_PARAM *param"
189.Fc
190.Ft int
191.Fo X509_VERIFY_PARAM_set1_email
192.Fa "X509_VERIFY_PARAM *param"
193.Fa "const char *email"
194.Fa "size_t emaillen"
195.Fc
196.Ft int
197.Fo X509_VERIFY_PARAM_set1_ip
198.Fa "X509_VERIFY_PARAM *param"
199.Fa "const unsigned char *ip"
200.Fa "size_t iplen"
201.Fc
202.Ft int
203.Fo X509_VERIFY_PARAM_set1_ip_asc
204.Fa "X509_VERIFY_PARAM *param"
205.Fa "const char *ipasc"
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
227.Sh DESCRIPTION
228These functions manipulate an
229.Vt X509_VERIFY_PARAM
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 .
272.Pp
273.Fn X509_VERIFY_PARAM_set_flags
274sets the flags in
275.Fa param
276by OR'ing it with
277.Fa flags .
278See the
279.Sx VERIFICATION FLAGS
280section for a complete description of values the
281.Fa flags
282parameter can take.
283.Pp
284.Fn X509_VERIFY_PARAM_get_flags
285returns the flags in
286.Fa param .
287.Pp
288.Fn X509_VERIFY_PARAM_clear_flags
289clears the flags
290.Fa flags
291in
292.Fa param .
293.Pp
294.Fn X509_VERIFY_PARAM_set_purpose
295sets the verification
296.Fa purpose
297identifier in
298.Fa param .
299This determines the acceptable purpose of the certificate chain, for example
300.Dv X509_PURPOSE_SSL_CLIENT
301or
302.Dv X509_PURPOSE_SSL_SERVER .
303Standard purposes are listed in
304.Xr X509_check_purpose 3 ,
305and additional purposes can be defined with
306.Xr X509_PURPOSE_add 3 .
307.Pp
308.Fn X509_VERIFY_PARAM_set_trust
309sets the trust setting in
310.Fa param
311to
312.Fa trust .
313.Pp
314.Fn X509_VERIFY_PARAM_set_time
315sets the verification time in
316.Fa param
317to
318.Fa t .
319Normally the current time is used.
320.Pp
321.Fn X509_VERIFY_PARAM_add0_policy
322enables policy checking (it is disabled by default) and adds
323.Fa policy
324to the acceptable policy set.
325.Pp
326.Fn X509_VERIFY_PARAM_set1_policies
327enables policy checking (it is disabled by default) and sets the
328acceptable policy set to
329.Fa policies .
330Any existing policy set is cleared.
331The
332.Fa policies
333parameter can be
334.Dv NULL
335to clear an existing policy set.
336.Pp
337.Fn X509_VERIFY_PARAM_set_depth
338sets the maximum verification depth to
339.Fa depth .
340That is the maximum number of untrusted CA certificates that can appear
341in a chain.
342.Pp
343.Fn X509_VERIFY_PARAM_set1_host
344sets the expected DNS hostname to
345.Fa name
346clearing any previously specified hostname or names.
347If
348.Fa name
349is
350.Dv NULL
351or empty, the list of hostnames is cleared, and name checks are not
352performed on the peer certificate.
353.Fa namelen
354should be set to the length of
355.Fa name .
356For historical compatibility, if
357.Fa name
358is NUL-terminated,
359.Fa namelen
360may be specified as zero.
361When a hostname is specified, certificate verification automatically
362invokes
363.Xr X509_check_host 3
364with flags equal to the
365.Fa flags
366argument given to
367.Fn X509_VERIFY_PARAM_set_hostflags
368(default zero).
369.Fn X509_VERIFY_PARAM_set1_host
370will fail if
371.Fa name
372contains any embedded 0 bytes.
373.Pp
374.Fn X509_VERIFY_PARAM_add1_host
375adds
376.Fa name
377as an additional reference identifier that can match the peer's
378certificate.
379Any previous names set via
380.Fn X509_VERIFY_PARAM_set1_host
381and
382.Fn X509_VERIFY_PARAM_add1_host
383are retained.
384No change is made if
385.Fa name
386is
387.Dv NULL
388or empty.
389.Fa namelen
390should be set to the length of
391.Fa name .
392For historical compatibility, if
393.Fa name
394is NUL-terminated,
395.Fa namelen
396may be specified as zero.
397.Fn X509_VERIFY_PARAM_add1_host
398will fail if
399.Fa name
400contains any embedded 0 bytes.
401When multiple names are configured, the peer is considered verified when
402any name matches.
403.Pp
404.Fn X509_VERIFY_PARAM_get0_peername
405returns the DNS hostname or subject CommonName from the peer certificate
406that matched one of the reference identifiers.
407When wildcard matching is not disabled, or when a reference identifier
408specifies a parent domain (starts with ".") rather than a hostname, the
409peer name may be a wildcard name or a sub-domain of the reference
410identifier respectively.
411.Pp
412.Fn X509_VERIFY_PARAM_set1_email
413sets the expected RFC 822 email address to
414.Fa email .
415.Fa emaillen
416should be set to the length of
417.Fa email .
418For historical compatibility, if
419.Fa email
420is NUL-terminated,
421.Fa emaillen
422may be specified as zero,
423.Fn X509_VERIFY_PARAM_set1_email
424will fail if
425.Fa email
426is NULL, an empty string, or contains embedded 0 bytes.
427When an email address is specified, certificate verification
428automatically invokes
429.Xr X509_check_email 3 .
430.Pp
431.Fn X509_VERIFY_PARAM_set1_ip
432sets the expected IP address to
433.Fa ip .
434The
435.Fa ip
436argument is in binary format, in network byte-order, and
437.Fa iplen
438must be set to 4 for IPv4 and 16 for IPv6.
439.Fn X509_VERIFY_PARAM_set1_ip
440will fail if
441.Fa ip
442is NULL or if
443.Fa iplen
444is not 4 or 16.
445When an IP address is specified,
446certificate verification automatically invokes
447.Xr X509_check_ip 3 .
448.Pp
449.Fn X509_VERIFY_PARAM_set1_ip_asc
450sets the expected IP address to
451.Fa ipasc .
452The
453.Fa ipasc
454argument is a NUL-terminal ASCII string:
455dotted decimal quad for IPv4 and colon-separated hexadecimal for IPv6.
456The condensed "::" notation is supported for IPv6 addresses.
457.Fn X509_VERIFY_PARAM_set1_ip_asc
458will fail if
459.Fa ipasc
460is unparsable.
461.Pp
462.Fn X509_VERIFY_PARAM_add0_table
463adds
464.Fa param
465to a static list of
466.Vt X509_VERIFY_PARAM
467objects maintained by the library.
468This function is extremely dangerous because contrary to the name
469of the function, if the list already contains an object that happens
470to have the same name, that old object is not only silently removed
471from the list, but also silently freed, which may silently invalidate
472various pointers existing elsewhere in the program.
473.Pp
474.Fn X509_VERIFY_PARAM_lookup
475searches this list for an object of the given
476.Fa name .
477If no match is found, the predefined objects built-in to the library
478are also inspected.
479.Pp
480.Fn X509_VERIFY_PARAM_get_count
481returns the sum of the number of objects on this list and the number
482of predefined objects built-in to the library.
483Note that this is not necessarily the total number of
484.Vt X509_VERIFY_PARAM
485objects existing in the program because there may be additional such
486objects that were never added to the list.
487.Pp
488.Fn X509_VERIFY_PARAM_get0
489accesses predefined and user-defined objects using
490.Fa id
491as an index, useful for looping over objects without knowing their names.
492An argument less than the number of predefined objects selects
493one of the predefined objects; a higher argument selects an object
494from the list.
495.Pp
496.Fn X509_VERIFY_PARAM_table_cleanup
497deletes all objects from this list.
498It is extremely dangerous because it also invalidates all data that
499was contained in all objects that were on the list and because it
500frees all these objects, which may invalidate various pointers
501existing elsewhere in the program.
502.Sh RETURN VALUES
503.Fn X509_VERIFY_PARAM_new
504returns a pointer to the new object, or
505.Dv NULL
506on allocation failure.
507.Pp
508.Fn X509_VERIFY_PARAM_set1_name ,
509.Fn X509_VERIFY_PARAM_set_flags ,
510.Fn X509_VERIFY_PARAM_clear_flags ,
511.Fn X509_VERIFY_PARAM_set_purpose ,
512.Fn X509_VERIFY_PARAM_set_trust ,
513.Fn X509_VERIFY_PARAM_add0_policy ,
514.Fn X509_VERIFY_PARAM_set1_policies ,
515and
516.Fn X509_VERIFY_PARAM_add0_table
517return 1 for success or 0 for failure.
518.Pp
519.Fn X509_VERIFY_PARAM_set1_host ,
520.Fn X509_VERIFY_PARAM_add1_host ,
521.Fn X509_VERIFY_PARAM_set1_email ,
522.Fn X509_VERIFY_PARAM_set1_ip ,
523and
524.Fn X509_VERIFY_PARAM_set1_ip_asc ,
525return 1 for success or 0 for failure.
526A failure from these routines will poison
527the
528.Vt X509_VERIFY_PARAM
529object so that future calls to
530.Xr X509_verify_cert 3
531using the poisoned object will fail.
532.Pp
533.Fn X509_VERIFY_PARAM_get_flags
534returns the current verification flags.
535.Pp
536.Fn X509_VERIFY_PARAM_get_depth
537returns the current verification depth.
538.Pp
539.Fn X509_VERIFY_PARAM_get0_name
540and
541.Fn X509_VERIFY_PARAM_get0_peername
542return pointers to strings that are only valid
543during the lifetime of the given
544.Fa param
545object and that must not be freed by the application program.
546.Pp
547.Fn X509_VERIFY_PARAM_lookup
548and
549.Fn X509_VERIFY_PARAM_get0
550return a pointer to an existing built-in or user-defined object, or
551.Dv NULL
552if no object with the given
553.Fa name
554is found, or if
555.Fa id
556is at least
557.Fn X509_VERIFY_PARAM_get_count .
558.Pp
559.Fn X509_VERIFY_PARAM_get_count
560returns a number of objects.
561.Sh VERIFICATION FLAGS
562The verification flags consists of zero or more of the following
563flags OR'ed together.
564.Pp
565.Dv X509_V_FLAG_CRL_CHECK
566enables CRL checking for the certificate chain leaf certificate.
567An error occurs if a suitable CRL cannot be found.
568.Pp
569.Dv X509_V_FLAG_CRL_CHECK_ALL
570enables CRL checking for the entire certificate chain.
571.Pp
572.Dv X509_V_FLAG_IGNORE_CRITICAL
573disables critical extension checking.
574By default any unhandled critical extensions in certificates or (if
575checked) CRLs results in a fatal error.
576If this flag is set unhandled critical extensions are ignored.
577.Sy WARNING :
578setting this option for anything other than debugging purposes can be a
579security risk.
580Finer control over which extensions are supported can be performed in
581the verification callback.
582.Pp
583The
584.Dv X509_V_FLAG_X509_STRICT
585flag disables workarounds for some broken certificates and makes the
586verification strictly apply X509 rules.
587.Pp
588.Dv X509_V_FLAG_ALLOW_PROXY_CERTS
589enables proxy certificate verification.
590.Pp
591.Dv X509_V_FLAG_POLICY_CHECK
592enables certificate policy checking; by default no policy checking is
593performed.
594Additional information is sent to the verification callback relating to
595policy checking.
596.Pp
597.Dv X509_V_FLAG_EXPLICIT_POLICY ,
598.Dv X509_V_FLAG_INHIBIT_ANY ,
599and
600.Dv X509_V_FLAG_INHIBIT_MAP
601set the
602.Dq require explicit policy ,
603.Dq inhibit any policy ,
604and
605.Dq inhibit policy mapping
606flags, respectively, as defined in RFC 3280.
607Policy checking is automatically enabled if any of these flags are set.
608.Pp
609If
610.Dv X509_V_FLAG_NOTIFY_POLICY
611is set and the policy checking is successful a special status code is
612set to the verification callback.
613This permits it to examine the valid policy tree and perform additional
614checks or simply log it for debugging purposes.
615.Pp
616By default some additional features such as indirect CRLs and CRLs
617signed by different keys are disabled.
618If
619.Dv X509_V_FLAG_EXTENDED_CRL_SUPPORT
620is set they are enabled.
621.Pp
622If
623.Dv X509_V_FLAG_USE_DELTAS
624is set, delta CRLs (if present) are used to determine certificate
625status.
626If not set, deltas are ignored.
627.Pp
628.Dv X509_V_FLAG_CHECK_SS_SIGNATURE
629enables checking of the root CA self signed certificate signature.
630By default this check is disabled because it doesn't add any additional
631security but in some cases applications might want to check the
632signature anyway.
633A side effect of not checking the root CA signature is that disabled or
634unsupported message digests on the root CA are not treated as fatal
635errors.
636.Pp
637The
638.Dv X509_V_FLAG_CB_ISSUER_CHECK
639flag enables debugging of certificate issuer checks.
640It is
641.Sy not
642needed unless you are logging certificate verification.
643If this flag is set then additional status codes will be sent to the
644verification callback and it
645.Sy must
646be prepared to handle such cases without assuming they are hard errors.
647.Pp
648When
649.Dv X509_V_FLAG_TRUSTED_FIRST
650is set, construction of the certificate chain in
651.Xr X509_verify_cert 3
652will search the trust store for issuer certificates before searching the
653provided untrusted certificates.
654Local issuer certificates are often more likely to satisfy local
655security requirements and lead to a locally trusted root.
656This is especially important when some certificates in the trust store
657have explicit trust settings; see the trust settings options of the
658.Cm x509
659command in
660.Xr openssl 1 .
661.Pp
662The
663.Dv X509_V_FLAG_NO_ALT_CHAINS
664flag suppresses checking for alternative chains.
665By default, unless
666.Dv X509_V_FLAG_TRUSTED_FIRST
667is set, when building a certificate chain, if the first certificate
668chain found is not trusted, then OpenSSL will attempt to replace
669untrusted certificates supplied by the peer with certificates from the
670trust store to see if an alternative chain can be found that is trusted.
671.Pp
672The
673.Dv X509_V_FLAG_PARTIAL_CHAIN
674flag causes intermediate certificates in the trust store to be treated
675as trust-anchors, in the same way as the self-signed root CA
676certificates.
677This makes it possible to trust certificates issued by an intermediate
678CA without having to trust its ancestor root CA.
679.Pp
680The
681.Dv X509_V_FLAG_NO_CHECK_TIME
682flag suppresses checking the validity period of certificates and CRLs
683against the current time.
684If
685.Fn X509_VERIFY_PARAM_set_time
686is used to specify a verification time, the check is not suppressed.
687.Sh EXAMPLES
688Enable CRL checking when performing certificate verification during
689SSL connections associated with an
690.Vt SSL_CTX
691structure
692.Fa ctx :
693.Bd -literal -offset indent
694X509_VERIFY_PARAM *param;
695
696param = X509_VERIFY_PARAM_new();
697X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
698SSL_CTX_set1_param(ctx, param);
699X509_VERIFY_PARAM_free(param);
700.Ed
701.Sh SEE ALSO
702.Xr SSL_set1_host 3 ,
703.Xr SSL_set1_param 3 ,
704.Xr X509_check_host 3 ,
705.Xr X509_STORE_CTX_set0_param 3 ,
706.Xr X509_STORE_set1_param 3 ,
707.Xr X509_verify_cert 3
708.Sh HISTORY
709.Fn X509_VERIFY_PARAM_new ,
710.Fn X509_VERIFY_PARAM_free ,
711.Fn X509_VERIFY_PARAM_set1_name ,
712.Fn X509_VERIFY_PARAM_set_flags ,
713.Fn X509_VERIFY_PARAM_set_purpose ,
714.Fn X509_VERIFY_PARAM_set_trust ,
715.Fn X509_VERIFY_PARAM_set_time ,
716.Fn X509_VERIFY_PARAM_add0_policy ,
717.Fn X509_VERIFY_PARAM_set1_policies ,
718.Fn X509_VERIFY_PARAM_set_depth ,
719.Fn X509_VERIFY_PARAM_get_depth ,
720.Fn X509_VERIFY_PARAM_add0_table ,
721.Fn X509_VERIFY_PARAM_lookup ,
722and
723.Fn X509_VERIFY_PARAM_table_cleanup
724first appeared in OpenSSL 0.9.8.
725.Fn X509_VERIFY_PARAM_clear_flags
726and
727.Fn X509_VERIFY_PARAM_get_flags
728first appeared in OpenSSL 0.9.8a.
729All these functions have been available since
730.Ox 4.5 .
731.Pp
732.Fn X509_VERIFY_PARAM_get0_name
733.Fn X509_VERIFY_PARAM_set1_host ,
734.Fn X509_VERIFY_PARAM_add1_host ,
735.Fn X509_VERIFY_PARAM_set_hostflags ,
736.Fn X509_VERIFY_PARAM_get0_peername ,
737.Fn X509_VERIFY_PARAM_set1_email ,
738.Fn X509_VERIFY_PARAM_set1_ip ,
739.Fn X509_VERIFY_PARAM_set1_ip_asc ,
740.Fn X509_VERIFY_PARAM_get_count ,
741and
742.Fn X509_VERIFY_PARAM_get0
743first appeared in OpenSSL 1.0.2 and have been available since
744.Ox 6.3 .
745.Sh BUGS
746Delta CRL checking is currently primitive.
747Only a single delta can be used and (partly due to limitations of
748.Vt X509_STORE )
749constructed CRLs are not maintained.
750.Pp
751If CRLs checking is enabled, CRLs are expected to be available in
752the corresponding
753.Vt X509_STORE
754structure.
755No attempt is made to download CRLs from the CRL distribution points
756extension.