]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/X509_VERIFY_PARAM_set_flags.3
MFC: r340703
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / X509_VERIFY_PARAM_set_flags.3
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "X509_VERIFY_PARAM_SET_FLAGS 3"
132 .TH X509_VERIFY_PARAM_SET_FLAGS 3 "2018-11-20" "1.1.1a" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 X509_VERIFY_PARAM_set_flags, X509_VERIFY_PARAM_clear_flags, X509_VERIFY_PARAM_get_flags, X509_VERIFY_PARAM_set_purpose, X509_VERIFY_PARAM_get_inh_flags, X509_VERIFY_PARAM_set_inh_flags, X509_VERIFY_PARAM_set_trust, X509_VERIFY_PARAM_set_depth, X509_VERIFY_PARAM_get_depth, X509_VERIFY_PARAM_set_auth_level, X509_VERIFY_PARAM_get_auth_level, X509_VERIFY_PARAM_set_time, X509_VERIFY_PARAM_get_time, X509_VERIFY_PARAM_add0_policy, X509_VERIFY_PARAM_set1_policies, X509_VERIFY_PARAM_set1_host, X509_VERIFY_PARAM_add1_host, X509_VERIFY_PARAM_set_hostflags, X509_VERIFY_PARAM_get_hostflags, X509_VERIFY_PARAM_get0_peername, X509_VERIFY_PARAM_set1_email, X509_VERIFY_PARAM_set1_ip, X509_VERIFY_PARAM_set1_ip_asc \&\- X509 verification parameters
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 .Vb 1
142 \& #include <openssl/x509_vfy.h>
143 \&
144 \& int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
145 \&                                 unsigned long flags);
146 \& int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
147 \&                                   unsigned long flags);
148 \& unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
149 \&
150 \& int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
151 \&                                     uint32_t flags);
152 \& uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
153 \&
154 \& int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
155 \& int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
156 \&
157 \& void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
158 \& time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
159 \&
160 \& int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
161 \&                                   ASN1_OBJECT *policy);
162 \& int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
163 \&                                     STACK_OF(ASN1_OBJECT) *policies);
164 \&
165 \& void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
166 \& int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
167 \&
168 \& void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param,
169 \&                                       int auth_level);
170 \& int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
171 \&
172 \& int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
173 \&                                 const char *name, size_t namelen);
174 \& int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
175 \&                                 const char *name, size_t namelen);
176 \& void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
177 \&                                      unsigned int flags);
178 \& unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
179 \& char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param);
180 \& int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
181 \&                                  const char *email, size_t emaillen);
182 \& int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
183 \&                               const unsigned char *ip, size_t iplen);
184 \& int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc);
185 .Ve
186 .SH "DESCRIPTION"
187 .IX Header "DESCRIPTION"
188 These functions manipulate the \fBX509_VERIFY_PARAM\fR structure associated with
189 a certificate verification operation.
190 .PP
191 The \fIX509_VERIFY_PARAM_set_flags()\fR function sets the flags in \fBparam\fR by oring
192 it with \fBflags\fR. See the \fB\s-1VERIFICATION FLAGS\s0\fR section for a complete
193 description of values the \fBflags\fR parameter can take.
194 .PP
195 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the flags in \fBparam\fR.
196 .PP
197 \&\fIX509_VERIFY_PARAM_get_inh_flags()\fR returns the inheritance flags in \fBparam\fR
198 which specifies how verification flags are copied from one structure to
199 another. \fIX509_VERIFY_PARAM_set_inh_flags()\fR sets the inheritance flags.
200 See the \fB\s-1INHERITANCE FLAGS\s0\fR section for a description of these bits.
201 .PP
202 \&\fIX509_VERIFY_PARAM_clear_flags()\fR clears the flags \fBflags\fR in \fBparam\fR.
203 .PP
204 \&\fIX509_VERIFY_PARAM_set_purpose()\fR sets the verification purpose in \fBparam\fR
205 to \fBpurpose\fR. This determines the acceptable purpose of the certificate
206 chain, for example \s-1SSL\s0 client or \s-1SSL\s0 server.
207 .PP
208 \&\fIX509_VERIFY_PARAM_set_trust()\fR sets the trust setting in \fBparam\fR to
209 \&\fBtrust\fR.
210 .PP
211 \&\fIX509_VERIFY_PARAM_set_time()\fR sets the verification time in \fBparam\fR to
212 \&\fBt\fR. Normally the current time is used.
213 .PP
214 \&\fIX509_VERIFY_PARAM_add0_policy()\fR enables policy checking (it is disabled
215 by default) and adds \fBpolicy\fR to the acceptable policy set.
216 .PP
217 \&\fIX509_VERIFY_PARAM_set1_policies()\fR enables policy checking (it is disabled
218 by default) and sets the acceptable policy set to \fBpolicies\fR. Any existing
219 policy set is cleared. The \fBpolicies\fR parameter can be \fB\s-1NULL\s0\fR to clear
220 an existing policy set.
221 .PP
222 \&\fIX509_VERIFY_PARAM_set_depth()\fR sets the maximum verification depth to \fBdepth\fR.
223 That is the maximum number of intermediate \s-1CA\s0 certificates that can appear in a
224 chain.
225 A maximal depth chain contains 2 more certificates than the limit, since
226 neither the end-entity certificate nor the trust-anchor count against this
227 limit.
228 Thus a \fBdepth\fR limit of 0 only allows the end-entity certificate to be signed
229 directly by the trust-anchor, while with a \fBdepth\fR limit of 1 there can be one
230 intermediate \s-1CA\s0 certificate between the trust-anchor and the end-entity
231 certificate.
232 .PP
233 \&\fIX509_VERIFY_PARAM_set_auth_level()\fR sets the authentication security level to
234 \&\fBauth_level\fR.
235 The authentication security level determines the acceptable signature and public
236 key strength when verifying certificate chains.
237 For a certificate chain to validate, the public keys of all the certificates
238 must meet the specified security level.
239 The signature algorithm security level is not enforced for the chain's \fItrust
240 anchor\fR certificate, which is either directly trusted or validated by means other
241 than its signature.
242 See \fISSL_CTX_set_security_level\fR\|(3) for the definitions of the available
243 levels.
244 The default security level is \-1, or \*(L"not set\*(R".
245 At security level 0 or lower all algorithms are acceptable.
246 Security level 1 requires at least 80\-bit\-equivalent security and is broadly
247 interoperable, though it will, for example, reject \s-1MD5\s0 signatures or \s-1RSA\s0 keys
248 shorter than 1024 bits.
249 .PP
250 \&\fIX509_VERIFY_PARAM_set1_host()\fR sets the expected \s-1DNS\s0 hostname to
251 \&\fBname\fR clearing any previously specified host name or names.  If
252 \&\fBname\fR is \s-1NULL,\s0 or empty the list of hostnames is cleared, and
253 name checks are not performed on the peer certificate.  If \fBname\fR
254 is NUL-terminated, \fBnamelen\fR may be zero, otherwise \fBnamelen\fR
255 must be set to the length of \fBname\fR.
256 .PP
257 When a hostname is specified,
258 certificate verification automatically invokes \fIX509_check_host\fR\|(3)
259 with flags equal to the \fBflags\fR argument given to
260 \&\fIX509_VERIFY_PARAM_set_hostflags()\fR (default zero).  Applications
261 are strongly advised to use this interface in preference to explicitly
262 calling \fIX509_check_host\fR\|(3), hostname checks may be out of scope
263 with the \s-1\fIDANE\-EE\s0\fR\|(3) certificate usage, and the internal check will
264 be suppressed as appropriate when \s-1DANE\s0 verification is enabled.
265 .PP
266 When the subject CommonName will not be ignored, whether as a result of the
267 \&\fBX509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT\fR host flag, or because no \s-1DNS\s0 subject
268 alternative names are present in the certificate, any \s-1DNS\s0 name constraints in
269 issuer certificates apply to the subject CommonName as well as the subject
270 alternative name extension.
271 .PP
272 When the subject CommonName will be ignored, whether as a result of the
273 \&\fBX509_CHECK_FLAG_NEVER_CHECK_SUBJECT\fR host flag, or because some \s-1DNS\s0 subject
274 alternative names are present in the certificate, \s-1DNS\s0 name constraints in
275 issuer certificates will not be applied to the subject \s-1DN.\s0
276 As described in \fIX509_check_host\fR\|(3) the \fBX509_CHECK_FLAG_NEVER_CHECK_SUBJECT\fR
277 flag takes precedence over the \fBX509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT\fR flag.
278 .PP
279 \&\fIX509_VERIFY_PARAM_get_hostflags()\fR returns any host flags previously set via a
280 call to \fIX509_VERIFY_PARAM_set_hostflags()\fR.
281 .PP
282 \&\fIX509_VERIFY_PARAM_add1_host()\fR adds \fBname\fR as an additional reference
283 identifier that can match the peer's certificate.  Any previous names
284 set via \fIX509_VERIFY_PARAM_set1_host()\fR or \fIX509_VERIFY_PARAM_add1_host()\fR
285 are retained, no change is made if \fBname\fR is \s-1NULL\s0 or empty.  When
286 multiple names are configured, the peer is considered verified when
287 any name matches.
288 .PP
289 \&\fIX509_VERIFY_PARAM_get0_peername()\fR returns the \s-1DNS\s0 hostname or subject
290 CommonName from the peer certificate that matched one of the reference
291 identifiers.  When wildcard matching is not disabled, or when a
292 reference identifier specifies a parent domain (starts with \*(L".\*(R")
293 rather than a hostname, the peer name may be a wildcard name or a
294 sub-domain of the reference identifier respectively.  The return
295 string is allocated by the library and is no longer valid once the
296 associated \fBparam\fR argument is freed.  Applications must not free
297 the return value.
298 .PP
299 \&\fIX509_VERIFY_PARAM_set1_email()\fR sets the expected \s-1RFC822\s0 email address to
300 \&\fBemail\fR.  If \fBemail\fR is NUL-terminated, \fBemaillen\fR may be zero, otherwise
301 \&\fBemaillen\fR must be set to the length of \fBemail\fR.  When an email address
302 is specified, certificate verification automatically invokes
303 \&\fIX509_check_email\fR\|(3).
304 .PP
305 \&\fIX509_VERIFY_PARAM_set1_ip()\fR sets the expected \s-1IP\s0 address to \fBip\fR.
306 The \fBip\fR argument is in binary format, in network byte-order and
307 \&\fBiplen\fR must be set to 4 for IPv4 and 16 for IPv6.  When an \s-1IP\s0
308 address is specified, certificate verification automatically invokes
309 \&\fIX509_check_ip\fR\|(3).
310 .PP
311 \&\fIX509_VERIFY_PARAM_set1_ip_asc()\fR sets the expected \s-1IP\s0 address to
312 \&\fBipasc\fR.  The \fBipasc\fR argument is a NUL-terminal \s-1ASCII\s0 string:
313 dotted decimal quad for IPv4 and colon-separated hexadecimal for
314 IPv6.  The condensed \*(L"::\*(R" notation is supported for IPv6 addresses.
315 .SH "RETURN VALUES"
316 .IX Header "RETURN VALUES"
317 \&\fIX509_VERIFY_PARAM_set_flags()\fR, \fIX509_VERIFY_PARAM_clear_flags()\fR,
318 \&\fIX509_VERIFY_PARAM_set_inh_flags()\fR,
319 \&\fIX509_VERIFY_PARAM_set_purpose()\fR, \fIX509_VERIFY_PARAM_set_trust()\fR,
320 \&\fIX509_VERIFY_PARAM_add0_policy()\fR \fIX509_VERIFY_PARAM_set1_policies()\fR,
321 \&\fIX509_VERIFY_PARAM_set1_host()\fR, \fIX509_VERIFY_PARAM_add1_host()\fR,
322 \&\fIX509_VERIFY_PARAM_set1_email()\fR, \fIX509_VERIFY_PARAM_set1_ip()\fR and
323 \&\fIX509_VERIFY_PARAM_set1_ip_asc()\fR return 1 for success and 0 for
324 failure.
325 .PP
326 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the current verification flags.
327 .PP
328 \&\fIX509_VERIFY_PARAM_get_hostflags()\fR returns any current host flags.
329 .PP
330 \&\fIX509_VERIFY_PARAM_get_inh_flags()\fR returns the current inheritance flags.
331 .PP
332 \&\fIX509_VERIFY_PARAM_set_time()\fR and \fIX509_VERIFY_PARAM_set_depth()\fR do not return
333 values.
334 .PP
335 \&\fIX509_VERIFY_PARAM_get_depth()\fR returns the current verification depth.
336 .PP
337 \&\fIX509_VERIFY_PARAM_get_auth_level()\fR returns the current authentication security
338 level.
339 .SH "VERIFICATION FLAGS"
340 .IX Header "VERIFICATION FLAGS"
341 The verification flags consists of zero or more of the following flags
342 ored together.
343 .PP
344 \&\fBX509_V_FLAG_CRL_CHECK\fR enables \s-1CRL\s0 checking for the certificate chain leaf
345 certificate. An error occurs if a suitable \s-1CRL\s0 cannot be found.
346 .PP
347 \&\fBX509_V_FLAG_CRL_CHECK_ALL\fR enables \s-1CRL\s0 checking for the entire certificate
348 chain.
349 .PP
350 \&\fBX509_V_FLAG_IGNORE_CRITICAL\fR disabled critical extension checking. By default
351 any unhandled critical extensions in certificates or (if checked) CRLs results
352 in a fatal error. If this flag is set unhandled critical extensions are
353 ignored. \fB\s-1WARNING\s0\fR setting this option for anything other than debugging
354 purposes can be a security risk. Finer control over which extensions are
355 supported can be performed in the verification callback.
356 .PP
357 The \fBX509_V_FLAG_X509_STRICT\fR flag disables workarounds for some broken
358 certificates and makes the verification strictly apply \fBX509\fR rules.
359 .PP
360 \&\fBX509_V_FLAG_ALLOW_PROXY_CERTS\fR enables proxy certificate verification.
361 .PP
362 \&\fBX509_V_FLAG_POLICY_CHECK\fR enables certificate policy checking, by default
363 no policy checking is performed. Additional information is sent to the
364 verification callback relating to policy checking.
365 .PP
366 \&\fBX509_V_FLAG_EXPLICIT_POLICY\fR, \fBX509_V_FLAG_INHIBIT_ANY\fR and
367 \&\fBX509_V_FLAG_INHIBIT_MAP\fR set the \fBrequire explicit policy\fR, \fBinhibit any
368 policy\fR and \fBinhibit policy mapping\fR flags respectively as defined in
369 \&\fB\s-1RFC3280\s0\fR. Policy checking is automatically enabled if any of these flags
370 are set.
371 .PP
372 If \fBX509_V_FLAG_NOTIFY_POLICY\fR is set and the policy checking is successful
373 a special status code is set to the verification callback. This permits it
374 to examine the valid policy tree and perform additional checks or simply
375 log it for debugging purposes.
376 .PP
377 By default some additional features such as indirect CRLs and CRLs signed by
378 different keys are disabled. If \fBX509_V_FLAG_EXTENDED_CRL_SUPPORT\fR is set
379 they are enabled.
380 .PP
381 If \fBX509_V_FLAG_USE_DELTAS\fR is set delta CRLs (if present) are used to
382 determine certificate status. If not set deltas are ignored.
383 .PP
384 \&\fBX509_V_FLAG_CHECK_SS_SIGNATURE\fR enables checking of the root \s-1CA\s0 self signed
385 certificate signature. By default this check is disabled because it doesn't
386 add any additional security but in some cases applications might want to
387 check the signature anyway. A side effect of not checking the root \s-1CA\s0
388 signature is that disabled or unsupported message digests on the root \s-1CA\s0
389 are not treated as fatal errors.
390 .PP
391 When \fBX509_V_FLAG_TRUSTED_FIRST\fR is set, construction of the certificate chain
392 in \fIX509_verify_cert\fR\|(3) will search the trust store for issuer certificates
393 before searching the provided untrusted certificates.
394 Local issuer certificates are often more likely to satisfy local security
395 requirements and lead to a locally trusted root.
396 This is especially important when some certificates in the trust store have
397 explicit trust settings (see \*(L"\s-1TRUST SETTINGS\*(R"\s0 in \fIx509\fR\|(1)).
398 As of OpenSSL 1.1.0 this option is on by default.
399 .PP
400 The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag suppresses checking for alternative
401 chains.
402 By default, unless \fBX509_V_FLAG_TRUSTED_FIRST\fR is set, when building a
403 certificate chain, if the first certificate chain found is not trusted, then
404 OpenSSL will attempt to replace untrusted certificates supplied by the peer
405 with certificates from the trust store to see if an alternative chain can be
406 found that is trusted.
407 As of OpenSSL 1.1.0, with \fBX509_V_FLAG_TRUSTED_FIRST\fR always set, this option
408 has no effect.
409 .PP
410 The \fBX509_V_FLAG_PARTIAL_CHAIN\fR flag causes intermediate certificates in the
411 trust store to be treated as trust-anchors, in the same way as the self-signed
412 root \s-1CA\s0 certificates.
413 This makes it possible to trust certificates issued by an intermediate \s-1CA\s0
414 without having to trust its ancestor root \s-1CA.\s0
415 With OpenSSL 1.1.0 and later and <X509_V_FLAG_PARTIAL_CHAIN> set, chain
416 construction stops as soon as the first certificate from the trust store is
417 added to the chain, whether that certificate is a self-signed \*(L"root\*(R"
418 certificate or a not self-signed intermediate certificate.
419 Thus, when an intermediate certificate is found in the trust store, the
420 verified chain passed to callbacks may be shorter than it otherwise would
421 be without the \fBX509_V_FLAG_PARTIAL_CHAIN\fR flag.
422 .PP
423 The \fBX509_V_FLAG_NO_CHECK_TIME\fR flag suppresses checking the validity period
424 of certificates and CRLs against the current time. If \fIX509_VERIFY_PARAM_set_time()\fR
425 is used to specify a verification time, the check is not suppressed.
426 .SH "INHERITANCE FLAGS"
427 .IX Header "INHERITANCE FLAGS"
428 These flags specify how parameters are \*(L"inherited\*(R" from one structure to
429 another.
430 .PP
431 If \fBX509_VP_FLAG_ONCE\fR is set then the current setting is zeroed
432 after the next call.
433 .PP
434 If \fBX509_VP_FLAG_LOCKED\fR is set then no values are copied.  This overrides
435 all of the following flags.
436 .PP
437 If \fBX509_VP_FLAG_DEFAULT\fR is set then anything set in the source is copied
438 to the destination. Effectively the values in \*(L"to\*(R" become default values
439 which will be used only if nothing new is set in \*(L"from\*(R".  This is the
440 default.
441 .PP
442 If \fBX509_VP_FLAG_OVERWRITE\fR is set then all value are copied across whether
443 they are set or not. Flags is still Ored though.
444 .PP
445 If \fBX509_VP_FLAG_RESET_FLAGS\fR is set then the flags value is copied instead
446 of ORed.
447 .SH "NOTES"
448 .IX Header "NOTES"
449 The above functions should be used to manipulate verification parameters
450 instead of functions which work in specific structures such as
451 \&\fIX509_STORE_CTX_set_flags()\fR which are likely to be deprecated in a future
452 release.
453 .SH "BUGS"
454 .IX Header "BUGS"
455 Delta \s-1CRL\s0 checking is currently primitive. Only a single delta can be used and
456 (partly due to limitations of \fBX509_STORE\fR) constructed CRLs are not
457 maintained.
458 .PP
459 If CRLs checking is enable CRLs are expected to be available in the
460 corresponding \fBX509_STORE\fR structure. No attempt is made to download
461 CRLs from the \s-1CRL\s0 distribution points extension.
462 .SH "EXAMPLE"
463 .IX Header "EXAMPLE"
464 Enable \s-1CRL\s0 checking when performing certificate verification during \s-1SSL\s0
465 connections associated with an \fB\s-1SSL_CTX\s0\fR structure \fBctx\fR:
466 .PP
467 .Vb 1
468 \& X509_VERIFY_PARAM *param;
469 \&
470 \& param = X509_VERIFY_PARAM_new();
471 \& X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
472 \& SSL_CTX_set1_param(ctx, param);
473 \& X509_VERIFY_PARAM_free(param);
474 .Ve
475 .SH "SEE ALSO"
476 .IX Header "SEE ALSO"
477 \&\fIX509_verify_cert\fR\|(3),
478 \&\fIX509_check_host\fR\|(3),
479 \&\fIX509_check_email\fR\|(3),
480 \&\fIX509_check_ip\fR\|(3),
481 \&\fIx509\fR\|(1)
482 .SH "HISTORY"
483 .IX Header "HISTORY"
484 The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag was added in OpenSSL 1.1.0
485 The flag \fBX509_V_FLAG_CB_ISSUER_CHECK\fR was deprecated in
486 OpenSSL 1.1.0, and has no effect.
487 .PP
488 \&\fIX509_VERIFY_PARAM_get_hostflags()\fR was added in OpenSSL 1.1.0i.
489 .SH "COPYRIGHT"
490 .IX Header "COPYRIGHT"
491 Copyright 2009\-2018 The OpenSSL Project Authors. All Rights Reserved.
492 .PP
493 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
494 this file except in compliance with the License.  You can obtain a copy
495 in the file \s-1LICENSE\s0 in the source distribution or at
496 <https://www.openssl.org/source/license.html>.