Debian Codegraph @

upstream/debian-unstable/man3/X509_STORE_set_verify_cb_func.3ssl

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\" ========================================================================
56 .\"
57 .IX Title "X509_STORE_SET_VERIFY_CB_FUNC 3SSL"
58 .TH X509_STORE_SET_VERIFY_CB_FUNC 3SSL 2026-04-07 3.6.2 OpenSSL
59 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
60 .\" way too many mistakes in technical documents.
61 .if n .ad l
62 .nh
63 .SH NAME
64 X509_STORE_set_lookup_crls_cb,
65 X509_STORE_set_verify_func,
66 X509_STORE_get_cleanup,
67 X509_STORE_set_cleanup,
68 X509_STORE_get_lookup_crls,
69 X509_STORE_set_lookup_crls,
70 X509_STORE_get_lookup_certs,
71 X509_STORE_set_lookup_certs,
72 X509_STORE_get_check_policy,
73 X509_STORE_set_check_policy,
74 X509_STORE_get_cert_crl,
75 X509_STORE_set_cert_crl,
76 X509_STORE_get_check_crl,
77 X509_STORE_set_check_crl,
78 X509_STORE_get_get_crl,
79 X509_STORE_set_get_crl,
80 X509_STORE_get_check_revocation,
81 X509_STORE_set_check_revocation,
82 X509_STORE_get_check_issued,
83 X509_STORE_set_check_issued,
84 X509_STORE_CTX_get1_issuer,
85 X509_STORE_get_get_issuer,
86 X509_STORE_set_get_issuer,
87 X509_STORE_CTX_get_verify,
88 X509_STORE_set_verify,
89 X509_STORE_get_verify_cb,
90 X509_STORE_set_verify_cb_func, X509_STORE_set_verify_cb,
91 X509_STORE_CTX_cert_crl_fn, X509_STORE_CTX_check_crl_fn,
92 X509_STORE_CTX_check_issued_fn, X509_STORE_CTX_check_policy_fn,
93 X509_STORE_CTX_check_revocation_fn, X509_STORE_CTX_cleanup_fn,
94 X509_STORE_CTX_get_crl_fn, X509_STORE_CTX_get_issuer_fn,
95 X509_STORE_CTX_lookup_certs_fn, X509_STORE_CTX_lookup_crls_fn
96 \&\- set verification callback
97 .SH SYNOPSIS
98 .IX Header "SYNOPSIS"
99 .Vb 1
100 \& #include <openssl/x509_vfy.h>
101 \&
102 \& typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
103 \& X509_STORE_CTX *ctx, X509 *x);
104 \& typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
105 \& X509 *x, X509 *issuer);
106 \& typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
107 \& typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
108 \& X509_CRL **crl, X509 *x);
109 \& typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
110 \& typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
111 \& X509_CRL *crl, X509 *x);
112 \& typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
113 \& typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
114 \& const X509_NAME *nm);
115 \& typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(const
116 \& X509_STORE_CTX *ctx,
117 \& const X509_NAME *nm);
118 \& typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
119 \&
120 \& void X509_STORE_set_verify_cb(X509_STORE *xs,
121 \& X509_STORE_CTX_verify_cb verify_cb);
122 \& X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE_CTX *ctx);
123 \&
124 \& void X509_STORE_set_verify(X509_STORE *xs, X509_STORE_CTX_verify_fn verify);
125 \& X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
126 \&
127 \& int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
128 \& X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE_CTX *ctx);
129 \& void X509_STORE_set_get_issuer(X509_STORE *xs,
130 \& X509_STORE_CTX_get_issuer_fn get_issuer);
131 \&
132 \& void X509_STORE_set_check_issued(X509_STORE *xs,
133 \& X509_STORE_CTX_check_issued_fn check_issued);
134 \& X509_STORE_CTX_check_issued_fn
135 \& X509_STORE_get_check_issued(const X509_STORE_CTX *ctx);
136 \&
137 \& void X509_STORE_set_check_revocation(X509_STORE *xs,
138 \& X509_STORE_CTX_check_revocation_fn check_revocation);
139 \& X509_STORE_CTX_check_revocation_fn
140 \& X509_STORE_get_check_revocation(const X509_STORE_CTX *ctx);
141 \&
142 \& void X509_STORE_set_get_crl(X509_STORE *xs,
143 \& X509_STORE_CTX_get_crl_fn get_crl);
144 \& X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE_CTX *ctx);
145 \&
146 \& void X509_STORE_set_check_crl(X509_STORE *xs,
147 \& X509_STORE_CTX_check_crl_fn check_crl);
148 \& X509_STORE_CTX_check_crl_fn
149 \& X509_STORE_get_check_crl(const X509_STORE_CTX *ctx);
150 \&
151 \& void X509_STORE_set_cert_crl(X509_STORE *xs,
152 \& X509_STORE_CTX_cert_crl_fn cert_crl);
153 \& X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE_CTX *ctx);
154 \&
155 \& void X509_STORE_set_check_policy(X509_STORE *xs,
156 \& X509_STORE_CTX_check_policy_fn check_policy);
157 \& X509_STORE_CTX_check_policy_fn
158 \& X509_STORE_get_check_policy(const X509_STORE_CTX *ctx);
159 \&
160 \& void X509_STORE_set_lookup_certs(X509_STORE *xs,
161 \& X509_STORE_CTX_lookup_certs_fn lookup_certs);
162 \& X509_STORE_CTX_lookup_certs_fn
163 \& X509_STORE_get_lookup_certs(const X509_STORE_CTX *ctx);
164 \&
165 \& void X509_STORE_set_lookup_crls(X509_STORE *xs,
166 \& X509_STORE_CTX_lookup_crls_fn lookup_crls);
167 \& X509_STORE_CTX_lookup_crls_fn
168 \& X509_STORE_get_lookup_crls(const X509_STORE_CTX *ctx);
169 \&
170 \& void X509_STORE_set_cleanup(X509_STORE *xs,
171 \& X509_STORE_CTX_cleanup_fn cleanup);
172 \& X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE_CTX *ctx);
173 \&
174 \& /* Aliases */
175 \& void X509_STORE_set_verify_cb_func(X509_STORE *st,
176 \& X509_STORE_CTX_verify_cb verify_cb);
177 \& void X509_STORE_set_verify_func(X509_STORE *xs,
178 \& X509_STORE_CTX_verify_fn verify);
179 \& void X509_STORE_set_lookup_crls_cb(X509_STORE *xs,
180 \& X509_STORE_CTX_lookup_crls_fn lookup_crls);
181 .Ve
182 .SH DESCRIPTION
183 .IX Header "DESCRIPTION"
184 \&\fBX509_STORE_set_verify_cb()\fR sets the verification callback of \fIxs\fR to
185 \&\fIverify_cb\fR overwriting the previous callback.
186 The callback assigned with this function becomes a default for the one
187 that can be assigned directly to the corresponding \fBX509_STORE_CTX\fR,
188 please see \fBX509_STORE_CTX_set_verify_cb\fR\|(3) for further information.
189 .PP
190 \&\fBX509_STORE_set_verify()\fR sets the final chain verification function for
191 \&\fIxs\fR to \fIverify\fR.
192 Its purpose is to go through the chain of certificates and check that
193 all signatures are valid and that the current time is within the
194 limits of each certificate's first and last validity time.
195 The final chain verification functions must return 0 on failure and 1
196 on success.
197 \&\fIIf no chain verification function is provided, the internal default
198 function will be used instead.\fR
199 .PP
200 \&\fBX509_STORE_CTX_get1_issuer()\fR tries to find a certificate from the \fIstore\fR
201 component of \fIctx\fR that has a subject name matching the issuer name of \fIx\fR
202 and is accepted by the \fIcheck_issued\fR function in \fIctx\fR.
203 On success it assigns to \fI*issuer\fR the first match that has a suitable validity
204 period or otherwise has the latest expiration date of all matching certificates.
205 If the function returns 1 the caller is responsible for freeing \fI*issuer\fR.
206 Note that this search does not support backtracking.
207 .PP
208 \&\fBX509_STORE_set_get_issuer()\fR sets the function \fIget_issuer\fR that is used
209 to get the "best" candidate issuer certificate of the given certificate \fIx\fR.
210 When such a certificate is found, \fIget_issuer\fR must up-ref and assign it
211 to \fI*issuer\fR and then return 1.
212 Otherwise \fIget_issuer\fR must return 0 if not found and \-1 (or 0) on failure.
213 If \fBX509_STORE_set_get_issuer()\fR is not used or \fIget_issuer\fR is NULL
214 then \fBX509_STORE_CTX_get1_issuer()\fR is used as the default implementation.
215 .PP
216 \&\fBX509_STORE_set_check_issued()\fR sets the function to check that a given
217 certificate \fIx\fR is issued by the issuer certificate \fIissuer\fR.
218 This function must return 0 on failure (among others if \fIx\fR hasn't
219 been issued with \fIissuer\fR) and 1 on success.
220 \&\fIIf no function to get the issuer is provided, the internal default
221 function will be used instead.\fR
222 .PP
223 \&\fBX509_STORE_set_check_revocation()\fR sets the revocation checking
224 function.
225 Its purpose is to look through the final chain and check the
226 revocation status for each certificate.
227 It must return 0 on failure and 1 on success.
228 \&\fIIf no function to get the issuer is provided, the internal default
229 function will be used instead.\fR
230 .PP
231 \&\fBX509_STORE_set_get_crl()\fR sets the function to get the crl for a given
232 certificate \fIx\fR.
233 When found, the crl must be assigned to \fI*crl\fR.
234 This function must return 0 on failure and 1 on success.
235 \&\fIIf no function to get the issuer is provided, the internal default
236 function will be used instead.\fR
237 .PP
238 \&\fBX509_STORE_set_check_crl()\fR sets the function to check the validity of
239 the given \fIcrl\fR.
240 This function must return 0 on failure and 1 on success.
241 \&\fIIf no function to get the issuer is provided, the internal default
242 function will be used instead.\fR
243 .PP
244 \&\fBX509_STORE_set_cert_crl()\fR sets the function to check the revocation
245 status of the given certificate \fIx\fR against the given \fIcrl\fR.
246 This function must return 0 on failure and 1 on success.
247 \&\fIIf no function to get the issuer is provided, the internal default
248 function will be used instead.\fR
249 .PP
250 \&\fBX509_STORE_set_check_policy()\fR sets the function to check the policies
251 of all the certificates in the final chain..
252 This function must return 0 on failure and 1 on success.
253 \&\fIIf no function to get the issuer is provided, the internal default
254 function will be used instead.\fR
255 .PP
256 \&\fBX509_STORE_set_lookup_certs()\fR and \fBX509_STORE_set_lookup_crls()\fR set the
257 functions to look up all the certs or all the CRLs that match the
258 given name \fInm\fR.
259 These functions return NULL on failure and a pointer to a stack of
260 certificates (\fBX509\fR) or to a stack of CRLs (\fBX509_CRL\fR) on
261 success.
262 \&\fIIf no function to get the issuer is provided, the internal default
263 function will be used instead.\fR
264 .PP
265 \&\fBX509_STORE_set_cleanup()\fR sets the final cleanup function, which is
266 called when the context (\fBX509_STORE_CTX\fR) is being torn down.
267 This function doesn't return any value.
268 \&\fIIf no function to get the issuer is provided, the internal default
269 function will be used instead.\fR
270 .PP
271 \&\fBX509_STORE_get_verify_cb()\fR, \fBX509_STORE_CTX_get_verify()\fR,
272 \&\fBX509_STORE_get_get_issuer()\fR, \fBX509_STORE_get_check_issued()\fR,
273 \&\fBX509_STORE_get_check_revocation()\fR, \fBX509_STORE_get_get_crl()\fR,
274 \&\fBX509_STORE_get_check_crl()\fR, \fBX509_STORE_set_verify()\fR,
275 \&\fBX509_STORE_set_get_issuer()\fR, \fBX509_STORE_get_cert_crl()\fR,
276 \&\fBX509_STORE_get_check_policy()\fR, \fBX509_STORE_get_lookup_certs()\fR,
277 \&\fBX509_STORE_get_lookup_crls()\fR and \fBX509_STORE_get_cleanup()\fR all return
278 the function pointer assigned with \fBX509_STORE_set_check_issued()\fR,
279 \&\fBX509_STORE_set_check_revocation()\fR, \fBX509_STORE_set_get_crl()\fR,
280 \&\fBX509_STORE_set_check_crl()\fR, \fBX509_STORE_set_cert_crl()\fR,
281 \&\fBX509_STORE_set_check_policy()\fR, \fBX509_STORE_set_lookup_certs()\fR,
282 \&\fBX509_STORE_set_lookup_crls()\fR and \fBX509_STORE_set_cleanup()\fR, or NULL if
283 no assignment has been made.
284 .PP
285 \&\fBX509_STORE_set_verify_cb_func()\fR, \fBX509_STORE_set_verify_func()\fR and
286 \&\fBX509_STORE_set_lookup_crls_cb()\fR are aliases for
287 \&\fBX509_STORE_set_verify_cb()\fR, \fBX509_STORE_set_verify()\fR and
288 X509_STORE_set_lookup_crls, available as macros for backward
289 compatibility.
290 .SH NOTES
291 .IX Header "NOTES"
292 All the callbacks from a \fBX509_STORE\fR are inherited by the
293 corresponding \fBX509_STORE_CTX\fR structure when it is initialized.
294 See \fBX509_STORE_CTX_set_verify_cb\fR\|(3) for further details.
295 .SH BUGS
296 .IX Header "BUGS"
297 The macro version of this function was the only one available before
298 OpenSSL 1.0.0.
299 .SH "RETURN VALUES"
300 .IX Header "RETURN VALUES"
301 The X509_STORE_set_*() functions do not return a value.
302 .PP
303 The X509_STORE_get_*() functions return a pointer of the appropriate
304 function type.
305 .PP
306 \&\fBX509_STORE_CTX_get1_issuer()\fR returns
307 1 if a suitable certificate is found, 0 if not found, \-1 on other error.
308 .SH "SEE ALSO"
309 .IX Header "SEE ALSO"
310 \&\fBX509_STORE_CTX_set_verify_cb\fR\|(3), \fBX509_STORE_CTX_get0_chain\fR\|(3),
311 \&\fBX509_STORE_CTX_verify_cb\fR\|(3), \fBX509_STORE_CTX_verify_fn\fR\|(3),
312 \&\fBCMS_verify\fR\|(3)
313 .SH HISTORY
314 .IX Header "HISTORY"
315 The \fBX509_STORE_set_verify_cb()\fR function was added in OpenSSL 1.0.0.
316 .PP
317 The functions
318 \&\fBX509_STORE_set_verify_cb()\fR, \fBX509_STORE_get_verify_cb()\fR,
319 \&\fBX509_STORE_set_verify()\fR, \fBX509_STORE_CTX_get_verify()\fR,
320 \&\fBX509_STORE_set_get_issuer()\fR, \fBX509_STORE_get_get_issuer()\fR,
321 \&\fBX509_STORE_set_check_issued()\fR, \fBX509_STORE_get_check_issued()\fR,
322 \&\fBX509_STORE_set_check_revocation()\fR, \fBX509_STORE_get_check_revocation()\fR,
323 \&\fBX509_STORE_set_get_crl()\fR, \fBX509_STORE_get_get_crl()\fR,
324 \&\fBX509_STORE_set_check_crl()\fR, \fBX509_STORE_get_check_crl()\fR,
325 \&\fBX509_STORE_set_cert_crl()\fR, \fBX509_STORE_get_cert_crl()\fR,
326 \&\fBX509_STORE_set_check_policy()\fR, \fBX509_STORE_get_check_policy()\fR,
327 \&\fBX509_STORE_set_lookup_certs()\fR, \fBX509_STORE_get_lookup_certs()\fR,
328 \&\fBX509_STORE_set_lookup_crls()\fR, \fBX509_STORE_get_lookup_crls()\fR,
329 \&\fBX509_STORE_set_cleanup()\fR and \fBX509_STORE_get_cleanup()\fR
330 were added in OpenSSL 1.1.0.
331 .SH COPYRIGHT
332 .IX Header "COPYRIGHT"
333 Copyright 2009\-2021 The OpenSSL Project Authors. All Rights Reserved.
334 .PP
335 Licensed under the Apache License 2.0 (the "License"). You may not use
336 this file except in compliance with the License. You can obtain a copy
337 in the file LICENSE in the source distribution or at
338 <https://www.openssl.org/source/license.html>.