1 .\" Automatically generated by Pod::Man 2.28 (Pod::Simple 3.28)
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
9 .de Vb \" Begin verbatim text
14 .de Ve \" End verbatim text
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<>.
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
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
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
49 .\" If the F register is turned on, 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.
54 .\" Avoid warning from groff about undefined register 'F'.
58 .if \n(.g .if rF .nr rF 1
59 .if (\n(rF:(\n(.g==0)) \{
62 . tm Index:\\$1\t\\n%\t"\\$2"
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
83 . ds #H ((1u-(\\\\n(.fu%2u))*.13m)
89 . \" simple accents for nroff and troff
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'
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 \
133 .\" ========================================================================
135 .IX Title "X509_VERIFY_PARAM_set_flags 3"
136 .TH X509_VERIFY_PARAM_set_flags 3 "2016-09-26" "1.0.2j" "OpenSSL"
137 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
138 .\" way too many mistakes in technical documents.
142 X509_VERIFY_PARAM_set_flags, X509_VERIFY_PARAM_clear_flags, X509_VERIFY_PARAM_get_flags, X509_VERIFY_PARAM_set_purpose, X509_VERIFY_PARAM_set_trust, X509_VERIFY_PARAM_set_depth, X509_VERIFY_PARAM_get_depth, X509_VERIFY_PARAM_set_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_get0_peername, X509_VERIFY_PARAM_set1_email, X509_VERIFY_PARAM_set1_ip, X509_VERIFY_PARAM_set1_ip_asc \- X509 verification parameters
144 .IX Header "SYNOPSIS"
146 \& #include <openssl/x509_vfy.h>
148 \& int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param, unsigned long flags);
149 \& int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
150 \& unsigned long flags);
151 \& unsigned long X509_VERIFY_PARAM_get_flags(X509_VERIFY_PARAM *param);
153 \& int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
154 \& int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
156 \& void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
158 \& int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
159 \& ASN1_OBJECT *policy);
160 \& int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
161 \& STACK_OF(ASN1_OBJECT) *policies);
163 \& void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
164 \& int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
166 \& int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
167 \& const char *name, size_t namelen);
168 \& int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
169 \& const char *name, size_t namelen);
170 \& void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
171 \& unsigned int flags);
172 \& char *X509_VERIFY_PARAM_get0_peername(X509_VERIFY_PARAM *param);
173 \& int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
174 \& const char *email, size_t emaillen);
175 \& int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
176 \& const unsigned char *ip, size_t iplen);
177 \& int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param, const char *ipasc);
180 .IX Header "DESCRIPTION"
181 These functions manipulate the \fBX509_VERIFY_PARAM\fR structure associated with
182 a certificate verification operation.
184 The \fIX509_VERIFY_PARAM_set_flags()\fR function sets the flags in \fBparam\fR by oring
185 it with \fBflags\fR. See the \fB\s-1VERIFICATION FLAGS\s0\fR section for a complete
186 description of values the \fBflags\fR parameter can take.
188 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the flags in \fBparam\fR.
190 \&\fIX509_VERIFY_PARAM_clear_flags()\fR clears the flags \fBflags\fR in \fBparam\fR.
192 \&\fIX509_VERIFY_PARAM_set_purpose()\fR sets the verification purpose in \fBparam\fR
193 to \fBpurpose\fR. This determines the acceptable purpose of the certificate
194 chain, for example \s-1SSL\s0 client or \s-1SSL\s0 server.
196 \&\fIX509_VERIFY_PARAM_set_trust()\fR sets the trust setting in \fBparam\fR to
199 \&\fIX509_VERIFY_PARAM_set_time()\fR sets the verification time in \fBparam\fR to
200 \&\fBt\fR. Normally the current time is used.
202 \&\fIX509_VERIFY_PARAM_add0_policy()\fR enables policy checking (it is disabled
203 by default) and adds \fBpolicy\fR to the acceptable policy set.
205 \&\fIX509_VERIFY_PARAM_set1_policies()\fR enables policy checking (it is disabled
206 by default) and sets the acceptable policy set to \fBpolicies\fR. Any existing
207 policy set is cleared. The \fBpolicies\fR parameter can be \fB\s-1NULL\s0\fR to clear
208 an existing policy set.
210 \&\fIX509_VERIFY_PARAM_set_depth()\fR sets the maximum verification depth to \fBdepth\fR.
211 That is the maximum number of untrusted \s-1CA\s0 certificates that can appear in a
214 \&\fIX509_VERIFY_PARAM_set1_host()\fR sets the expected \s-1DNS\s0 hostname to
215 \&\fBname\fR clearing any previously specified host name or names. If
216 \&\fBname\fR is \s-1NULL,\s0 or empty the list of hostnames is cleared, and
217 name checks are not performed on the peer certificate. If \fBname\fR
218 is NUL-terminated, \fBnamelen\fR may be zero, otherwise \fBnamelen\fR
219 must be set to the length of \fBname\fR. When a hostname is specified,
220 certificate verification automatically invokes \fIX509_check_host\fR\|(3)
221 with flags equal to the \fBflags\fR argument given to
222 \&\fB\f(BIX509_VERIFY_PARAM_set_hostflags()\fB\fR (default zero). Applications
223 are strongly advised to use this interface in preference to explicitly
224 calling \fIX509_check_host\fR\|(3), hostname checks are out of scope
225 with the \s-1\fIDANE\-EE\s0\fR\|(3) certificate usage, and the internal check will
226 be suppressed as appropriate when \s-1DANE\s0 support is added to OpenSSL.
228 \&\fIX509_VERIFY_PARAM_add1_host()\fR adds \fBname\fR as an additional reference
229 identifer that can match the peer's certificate. Any previous names
230 set via \fIX509_VERIFY_PARAM_set1_host()\fR or \fIX509_VERIFY_PARAM_add1_host()\fR
231 are retained, no change is made if \fBname\fR is \s-1NULL\s0 or empty. When
232 multiple names are configured, the peer is considered verified when
235 \&\fIX509_VERIFY_PARAM_get0_peername()\fR returns the \s-1DNS\s0 hostname or subject
236 CommonName from the peer certificate that matched one of the reference
237 identifiers. When wildcard matching is not disabled, or when a
238 reference identifier specifies a parent domain (starts with \*(L".\*(R")
239 rather than a hostname, the peer name may be a wildcard name or a
240 sub-domain of the reference identifier respectively. The return
241 string is allocated by the library and is no longer valid once the
242 associated \fBparam\fR argument is freed. Applications must not free
245 \&\fIX509_VERIFY_PARAM_set1_email()\fR sets the expected \s-1RFC822\s0 email address to
246 \&\fBemail\fR. If \fBemail\fR is NUL-terminated, \fBemaillen\fR may be zero, otherwise
247 \&\fBemaillen\fR must be set to the length of \fBemail\fR. When an email address
248 is specified, certificate verification automatically invokes
249 \&\fIX509_check_email\fR\|(3).
251 \&\fIX509_VERIFY_PARAM_set1_ip()\fR sets the expected \s-1IP\s0 address to \fBip\fR.
252 The \fBip\fR argument is in binary format, in network byte-order and
253 \&\fBiplen\fR must be set to 4 for IPv4 and 16 for IPv6. When an \s-1IP\s0
254 address is specified, certificate verification automatically invokes
255 \&\fIX509_check_ip\fR\|(3).
257 \&\fIX509_VERIFY_PARAM_set1_ip_asc()\fR sets the expected \s-1IP\s0 address to
258 \&\fBipasc\fR. The \fBipasc\fR argument is a NUL-terminal \s-1ASCII\s0 string:
259 dotted decimal quad for IPv4 and colon-separated hexadecimal for
260 IPv6. The condensed \*(L"::\*(R" notation is supported for IPv6 addresses.
262 .IX Header "RETURN VALUES"
263 \&\fIX509_VERIFY_PARAM_set_flags()\fR, \fIX509_VERIFY_PARAM_clear_flags()\fR,
264 \&\fIX509_VERIFY_PARAM_set_purpose()\fR, \fIX509_VERIFY_PARAM_set_trust()\fR,
265 \&\fIX509_VERIFY_PARAM_add0_policy()\fR \fIX509_VERIFY_PARAM_set1_policies()\fR,
266 \&\fIX509_VERIFY_PARAM_set1_host()\fR, \fIX509_VERIFY_PARAM_set_hostflags()\fR,
267 \&\fIX509_VERIFY_PARAM_set1_email()\fR, \fIX509_VERIFY_PARAM_set1_ip()\fR and
268 \&\fIX509_VERIFY_PARAM_set1_ip_asc()\fR return 1 for success and 0 for
271 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the current verification flags.
273 \&\fIX509_VERIFY_PARAM_set_time()\fR and \fIX509_VERIFY_PARAM_set_depth()\fR do not return
276 \&\fIX509_VERIFY_PARAM_get_depth()\fR returns the current verification depth.
277 .SH "VERIFICATION FLAGS"
278 .IX Header "VERIFICATION FLAGS"
279 The verification flags consists of zero or more of the following flags
282 \&\fBX509_V_FLAG_CRL_CHECK\fR enables \s-1CRL\s0 checking for the certificate chain leaf
283 certificate. An error occurs if a suitable \s-1CRL\s0 cannot be found.
285 \&\fBX509_V_FLAG_CRL_CHECK_ALL\fR enables \s-1CRL\s0 checking for the entire certificate
288 \&\fBX509_V_FLAG_IGNORE_CRITICAL\fR disabled critical extension checking. By default
289 any unhandled critical extensions in certificates or (if checked) CRLs results
290 in a fatal error. If this flag is set unhandled critical extensions are
291 ignored. \fB\s-1WARNING\s0\fR setting this option for anything other than debugging
292 purposes can be a security risk. Finer control over which extensions are
293 supported can be performed in the verification callback.
295 THe \fBX509_V_FLAG_X509_STRICT\fR flag disables workarounds for some broken
296 certificates and makes the verification strictly apply \fBX509\fR rules.
298 \&\fBX509_V_FLAG_ALLOW_PROXY_CERTS\fR enables proxy certificate verification.
300 \&\fBX509_V_FLAG_POLICY_CHECK\fR enables certificate policy checking, by default
301 no policy checking is peformed. Additional information is sent to the
302 verification callback relating to policy checking.
304 \&\fBX509_V_FLAG_EXPLICIT_POLICY\fR, \fBX509_V_FLAG_INHIBIT_ANY\fR and
305 \&\fBX509_V_FLAG_INHIBIT_MAP\fR set the \fBrequire explicit policy\fR, \fBinhibit any
306 policy\fR and \fBinhibit policy mapping\fR flags respectively as defined in
307 \&\fB\s-1RFC3280\s0\fR. Policy checking is automatically enabled if any of these flags
310 If \fBX509_V_FLAG_NOTIFY_POLICY\fR is set and the policy checking is successful
311 a special status code is set to the verification callback. This permits it
312 to examine the valid policy tree and perform additional checks or simply
313 log it for debugging purposes.
315 By default some additional features such as indirect CRLs and CRLs signed by
316 different keys are disabled. If \fBX509_V_FLAG_EXTENDED_CRL_SUPPORT\fR is set
319 If \fBX509_V_FLAG_USE_DELTAS\fR ise set delta CRLs (if present) are used to
320 determine certificate status. If not set deltas are ignored.
322 \&\fBX509_V_FLAG_CHECK_SS_SIGNATURE\fR enables checking of the root \s-1CA\s0 self signed
323 cerificate signature. By default this check is disabled because it doesn't
324 add any additional security but in some cases applications might want to
325 check the signature anyway. A side effect of not checking the root \s-1CA\s0
326 signature is that disabled or unsupported message digests on the root \s-1CA\s0
327 are not treated as fatal errors.
329 The \fBX509_V_FLAG_CB_ISSUER_CHECK\fR flag enables debugging of certificate
330 issuer checks. It is \fBnot\fR needed unless you are logging certificate
331 verification. If this flag is set then additional status codes will be sent
332 to the verification callback and it \fBmust\fR be prepared to handle such cases
333 without assuming they are hard errors.
335 The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag suppresses checking for alternative
336 chains. By default, when building a certificate chain, if the first certificate
337 chain found is not trusted, then OpenSSL will continue to check to see if an
338 alternative chain can be found that is trusted. With this flag set the behaviour
339 will match that of OpenSSL versions prior to 1.0.2b.
342 The above functions should be used to manipulate verification parameters
343 instead of legacy functions which work in specific structures such as
344 \&\fIX509_STORE_CTX_set_flags()\fR.
347 Delta \s-1CRL\s0 checking is currently primitive. Only a single delta can be used and
348 (partly due to limitations of \fBX509_STORE\fR) constructed CRLs are not
351 If CRLs checking is enable CRLs are expected to be available in the
352 corresponding \fBX509_STORE\fR structure. No attempt is made to download
353 CRLs from the \s-1CRL\s0 distribution points extension.
356 Enable \s-1CRL\s0 checking when performing certificate verification during \s-1SSL \s0
357 connections associated with an \fB\s-1SSL_CTX\s0\fR structure \fBctx\fR:
360 \& X509_VERIFY_PARAM *param;
361 \& param = X509_VERIFY_PARAM_new();
362 \& X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
363 \& SSL_CTX_set1_param(ctx, param);
364 \& X509_VERIFY_PARAM_free(param);
367 .IX Header "SEE ALSO"
368 \&\fIX509_verify_cert\fR\|(3),
369 \&\fIX509_check_host\fR\|(3),
370 \&\fIX509_check_email\fR\|(3),
371 \&\fIX509_check_ip\fR\|(3)
374 The \fBX509_V_FLAG_NO_ALT_CHAINS\fR flag was added in OpenSSL 1.0.2b