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