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