dc15f987124df0ce00ff6a4e79af09a66123fc2c
[dragonfly.git] / secure / lib / libcrypto / man / X509_VERIFY_PARAM_set_flags.3
1 .\" Automatically generated by Pod::Man 2.27 (Pod::Simple 3.28)
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 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.
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 "2015-03-19" "1.0.1m" "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_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 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, 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);
152 \&
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);
155 \&
156 \& void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
157 \&
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);
162 \&
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);
165 .Ve
166 .SH "DESCRIPTION"
167 .IX Header "DESCRIPTION"
168 These functions manipulate the \fBX509_VERIFY_PARAM\fR structure associated with
169 a certificate verification operation.
170 .PP
171 The \fIX509_VERIFY_PARAM_set_flags()\fR function sets the flags in \fBparam\fR by oring
172 it with \fBflags\fR. See the \fB\s-1VERIFICATION FLAGS\s0\fR section for a complete
173 description of values the \fBflags\fR parameter can take.
174 .PP
175 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the flags in \fBparam\fR.
176 .PP
177 \&\fIX509_VERIFY_PARAM_clear_flags()\fR clears the flags \fBflags\fR in \fBparam\fR.
178 .PP
179 \&\fIX509_VERIFY_PARAM_set_purpose()\fR sets the verification purpose in \fBparam\fR
180 to \fBpurpose\fR. This determines the acceptable purpose of the certificate
181 chain, for example \s-1SSL\s0 client or \s-1SSL\s0 server.
182 .PP
183 \&\fIX509_VERIFY_PARAM_set_trust()\fR sets the trust setting in \fBparam\fR to 
184 \&\fBtrust\fR.
185 .PP
186 \&\fIX509_VERIFY_PARAM_set_time()\fR sets the verification time in \fBparam\fR to
187 \&\fBt\fR. Normally the current time is used.
188 .PP
189 \&\fIX509_VERIFY_PARAM_add0_policy()\fR enables policy checking (it is disabled
190 by default) and adds \fBpolicy\fR to the acceptable policy set.
191 .PP
192 \&\fIX509_VERIFY_PARAM_set1_policies()\fR enables policy checking (it is disabled
193 by default) and sets the acceptable policy set to \fBpolicies\fR. Any existing
194 policy set is cleared. The \fBpolicies\fR parameter can be \fB\s-1NULL\s0\fR to clear
195 an existing policy set.
196 .PP
197 \&\fIX509_VERIFY_PARAM_set_depth()\fR sets the maximum verification depth to \fBdepth\fR.
198 That is the maximum number of untrusted \s-1CA\s0 certificates that can appear in a
199 chain.
200 .SH "RETURN VALUES"
201 .IX Header "RETURN VALUES"
202 \&\fIX509_VERIFY_PARAM_set_flags()\fR, \fIX509_VERIFY_PARAM_clear_flags()\fR, 
203 \&\fIX509_VERIFY_PARAM_set_purpose()\fR, \fIX509_VERIFY_PARAM_set_trust()\fR,
204 \&\fIX509_VERIFY_PARAM_add0_policy()\fR and \fIX509_VERIFY_PARAM_set1_policies()\fR return 1
205 for success and 0 for failure.
206 .PP
207 \&\fIX509_VERIFY_PARAM_get_flags()\fR returns the current verification flags.
208 .PP
209 \&\fIX509_VERIFY_PARAM_set_time()\fR and \fIX509_VERIFY_PARAM_set_depth()\fR do not return
210 values.
211 .PP
212 \&\fIX509_VERIFY_PARAM_get_depth()\fR returns the current verification depth.
213 .SH "VERIFICATION FLAGS"
214 .IX Header "VERIFICATION FLAGS"
215 The verification flags consists of zero or more of the following flags
216 ored together.
217 .PP
218 \&\fBX509_V_FLAG_CRL_CHECK\fR enables \s-1CRL\s0 checking for the certificate chain leaf
219 certificate. An error occurs if a suitable \s-1CRL\s0 cannot be found.
220 .PP
221 \&\fBX509_V_FLAG_CRL_CHECK_ALL\fR enables \s-1CRL\s0 checking for the entire certificate
222 chain.
223 .PP
224 \&\fBX509_V_FLAG_IGNORE_CRITICAL\fR disabled critical extension checking. By default
225 any unhandled critical extensions in certificates or (if checked) CRLs results
226 in a fatal error. If this flag is set unhandled critical extensions are
227 ignored. \fB\s-1WARNING\s0\fR setting this option for anything other than debugging
228 purposes can be a security risk. Finer control over which extensions are
229 supported can be performed in the verification callback.
230 .PP
231 THe \fBX509_V_FLAG_X509_STRICT\fR flag disables workarounds for some broken
232 certificates and makes the verification strictly apply \fBX509\fR rules.
233 .PP
234 \&\fBX509_V_FLAG_ALLOW_PROXY_CERTS\fR enables proxy certificate verification.
235 .PP
236 \&\fBX509_V_FLAG_POLICY_CHECK\fR enables certificate policy checking, by default
237 no policy checking is peformed. Additional information is sent to the 
238 verification callback relating to policy checking.
239 .PP
240 \&\fBX509_V_FLAG_EXPLICIT_POLICY\fR, \fBX509_V_FLAG_INHIBIT_ANY\fR and
241 \&\fBX509_V_FLAG_INHIBIT_MAP\fR set the \fBrequire explicit policy\fR, \fBinhibit any
242 policy\fR and \fBinhibit policy mapping\fR flags respectively as defined in
243 \&\fB\s-1RFC3280\s0\fR. Policy checking is automatically enabled if any of these flags
244 are set.
245 .PP
246 If \fBX509_V_FLAG_NOTIFY_POLICY\fR is set and the policy checking is successful
247 a special status code is set to the verification callback. This permits it
248 to examine the valid policy tree and perform additional checks or simply
249 log it for debugging purposes.
250 .PP
251 By default some additional features such as indirect CRLs and CRLs signed by
252 different keys are disabled. If \fBX509_V_FLAG_EXTENDED_CRL_SUPPORT\fR is set
253 they are enabled.
254 .PP
255 If \fBX509_V_FLAG_USE_DELTAS\fR ise set delta CRLs (if present) are used to
256 determine certificate status. If not set deltas are ignored.
257 .PP
258 \&\fBX509_V_FLAG_CHECK_SS_SIGNATURE\fR enables checking of the root \s-1CA\s0 self signed
259 cerificate signature. By default this check is disabled because it doesn't
260 add any additional security but in some cases applications might want to
261 check the signature anyway. A side effect of not checking the root \s-1CA\s0
262 signature is that disabled or unsupported message digests on the root \s-1CA\s0
263 are not treated as fatal errors.
264 .PP
265 The \fBX509_V_FLAG_CB_ISSUER_CHECK\fR flag enables debugging of certificate
266 issuer checks. It is \fBnot\fR needed unless you are logging certificate
267 verification. If this flag is set then additional status codes will be sent
268 to the verification callback and it \fBmust\fR be prepared to handle such cases
269 without assuming they are hard errors.
270 .SH "NOTES"
271 .IX Header "NOTES"
272 The above functions should be used to manipulate verification parameters
273 instead of legacy functions which work in specific structures such as
274 \&\fIX509_STORE_CTX_set_flags()\fR.
275 .SH "BUGS"
276 .IX Header "BUGS"
277 Delta \s-1CRL\s0 checking is currently primitive. Only a single delta can be used and
278 (partly due to limitations of \fBX509_STORE\fR) constructed CRLs are not 
279 maintained.
280 .PP
281 If CRLs checking is enable CRLs are expected to be available in the
282 corresponding \fBX509_STORE\fR structure. No attempt is made to download
283 CRLs from the \s-1CRL\s0 distribution points extension.
284 .SH "EXAMPLE"
285 .IX Header "EXAMPLE"
286 Enable \s-1CRL\s0 checking when performing certificate verification during \s-1SSL \s0
287 connections associated with an \fB\s-1SSL_CTX\s0\fR structure \fBctx\fR:
288 .PP
289 .Vb 5
290 \&  X509_VERIFY_PARAM *param;
291 \&  param = X509_VERIFY_PARAM_new();
292 \&  X509_VERIFY_PARAM_set_flags(param, X509_V_FLAG_CRL_CHECK);
293 \&  SSL_CTX_set1_param(ctx, param);
294 \&  X509_VERIFY_PARAM_free(param);
295 .Ve
296 .SH "SEE ALSO"
297 .IX Header "SEE ALSO"
298 \&\fIX509_verify_cert\fR\|(3)
299 .SH "HISTORY"
300 .IX Header "HISTORY"
301 \&\s-1TBA\s0