1X509_STORE_SET_VERIFY_CB_FUNC(3) OpenSSL X509_STORE_SET_VERIFY_CB_FUNC(3)
2
3
4
6 X509_STORE_set_lookup_crls_cb, X509_STORE_set_verify_func,
7 X509_STORE_get_cleanup, X509_STORE_set_cleanup,
8 X509_STORE_get_lookup_crls, X509_STORE_set_lookup_crls,
9 X509_STORE_get_lookup_certs, X509_STORE_set_lookup_certs,
10 X509_STORE_get_check_policy, X509_STORE_set_check_policy,
11 X509_STORE_get_cert_crl, X509_STORE_set_cert_crl,
12 X509_STORE_get_check_crl, X509_STORE_set_check_crl,
13 X509_STORE_get_get_crl, X509_STORE_set_get_crl,
14 X509_STORE_get_check_revocation, X509_STORE_set_check_revocation,
15 X509_STORE_get_check_issued, X509_STORE_set_check_issued,
16 X509_STORE_get_get_issuer, X509_STORE_set_get_issuer,
17 X509_STORE_CTX_get_verify, X509_STORE_set_verify,
18 X509_STORE_get_verify_cb, X509_STORE_set_verify_cb_func,
19 X509_STORE_set_verify_cb, X509_STORE_CTX_cert_crl_fn,
20 X509_STORE_CTX_check_crl_fn, X509_STORE_CTX_check_issued_fn,
21 X509_STORE_CTX_check_policy_fn, X509_STORE_CTX_check_revocation_fn,
22 X509_STORE_CTX_cleanup_fn, X509_STORE_CTX_get_crl_fn,
23 X509_STORE_CTX_get_issuer_fn, X509_STORE_CTX_lookup_certs_fn,
24 X509_STORE_CTX_lookup_crls_fn - set verification callback
25
27 #include <openssl/x509_vfy.h>
28
29 typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
30 X509_STORE_CTX *ctx, X509 *x);
31 typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
32 X509 *x, X509 *issuer);
33 typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
34 typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
35 X509_CRL **crl, X509 *x);
36 typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
37 typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
38 X509_CRL *crl, X509 *x);
39 typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
40 typedef STACK_OF(X509) *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
41 X509_NAME *nm);
42 typedef STACK_OF(X509_CRL) *(*X509_STORE_CTX_lookup_crls_fn)(X509_STORE_CTX *ctx,
43 X509_NAME *nm);
44 typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
45
46 void X509_STORE_set_verify_cb(X509_STORE *ctx,
47 X509_STORE_CTX_verify_cb verify_cb);
48 X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(X509_STORE_CTX *ctx);
49
50 void X509_STORE_set_verify(X509_STORE *ctx, X509_STORE_CTX_verify_fn verify);
51 X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(X509_STORE_CTX *ctx);
52
53 void X509_STORE_set_get_issuer(X509_STORE *ctx,
54 X509_STORE_CTX_get_issuer_fn get_issuer);
55 X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(X509_STORE_CTX *ctx);
56
57 void X509_STORE_set_check_issued(X509_STORE *ctx,
58 X509_STORE_CTX_check_issued_fn check_issued);
59 X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(X509_STORE_CTX *ctx);
60
61 void X509_STORE_set_check_revocation(X509_STORE *ctx,
62 X509_STORE_CTX_check_revocation_fn check_revocation);
63 X509_STORE_CTX_check_revocation_fn X509_STORE_get_check_revocation(X509_STORE_CTX *ctx);
64
65 void X509_STORE_set_get_crl(X509_STORE *ctx,
66 X509_STORE_CTX_get_crl_fn get_crl);
67 X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(X509_STORE_CTX *ctx);
68
69 void X509_STORE_set_check_crl(X509_STORE *ctx,
70 X509_STORE_CTX_check_crl_fn check_crl);
71 X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(X509_STORE_CTX *ctx);
72
73 void X509_STORE_set_cert_crl(X509_STORE *ctx,
74 X509_STORE_CTX_cert_crl_fn cert_crl);
75 X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(X509_STORE_CTX *ctx);
76
77 void X509_STORE_set_check_policy(X509_STORE *ctx,
78 X509_STORE_CTX_check_policy_fn check_policy);
79 X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(X509_STORE_CTX *ctx);
80
81 void X509_STORE_set_lookup_certs(X509_STORE *ctx,
82 X509_STORE_CTX_lookup_certs_fn lookup_certs);
83 X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(X509_STORE_CTX *ctx);
84
85 void X509_STORE_set_lookup_crls(X509_STORE *ctx,
86 X509_STORE_CTX_lookup_crls_fn lookup_crls);
87 X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(X509_STORE_CTX *ctx);
88
89 void X509_STORE_set_cleanup(X509_STORE *ctx,
90 X509_STORE_CTX_cleanup_fn cleanup);
91 X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(X509_STORE_CTX *ctx);
92
93 /* Aliases */
94 void X509_STORE_set_verify_cb_func(X509_STORE *st,
95 X509_STORE_CTX_verify_cb verify_cb);
96 void X509_STORE_set_verify_func(X509_STORE *ctx,
97 X509_STORE_CTX_verify_fn verify);
98 void X509_STORE_set_lookup_crls_cb(X509_STORE *ctx,
99 X509_STORE_CTX_lookup_crls_fn lookup_crls);
100
102 X509_STORE_set_verify_cb() sets the verification callback of ctx to
103 verify_cb overwriting the previous callback. The callback assigned
104 with this function becomes a default for the one that can be assigned
105 directly to the corresponding X509_STORE_CTX, please see
106 X509_STORE_CTX_set_verify_cb(3) for further information.
107
108 X509_STORE_set_verify() sets the final chain verification function for
109 ctx to verify. Its purpose is to go through the chain of certificates
110 and check that all signatures are valid and that the current time is
111 within the limits of each certificate's first and last validity time.
112 The final chain verification functions must return 0 on failure and 1
113 on success. If no chain verification function is provided, the
114 internal default function will be used instead.
115
116 X509_STORE_set_get_issuer() sets the function to get the issuer
117 certificate that verifies the given certificate x. When found, the
118 issuer certificate must be assigned to *issuer. This function must
119 return 0 on failure and 1 on success. If no function to get the issuer
120 is provided, the internal default function will be used instead.
121
122 X509_STORE_set_check_issued() sets the function to check that a given
123 certificate x is issued with the issuer certificate issuer. This
124 function must return 0 on failure (among others if x hasn't been issued
125 with issuer) and 1 on success. If no function to get the issuer is
126 provided, the internal default function will be used instead.
127
128 X509_STORE_set_check_revocation() sets the revocation checking
129 function. Its purpose is to look through the final chain and check the
130 revocation status for each certificate. It must return 0 on failure
131 and 1 on success. If no function to get the issuer is provided, the
132 internal default function will be used instead.
133
134 X509_STORE_set_get_crl() sets the function to get the crl for a given
135 certificate x. When found, the crl must be assigned to *crl. This
136 function must return 0 on failure and 1 on success. If no function to
137 get the issuer is provided, the internal default function will be used
138 instead.
139
140 X509_STORE_set_check_crl() sets the function to check the validity of
141 the given crl. This function must return 0 on failure and 1 on
142 success. If no function to get the issuer is provided, the internal
143 default function will be used instead.
144
145 X509_STORE_set_cert_crl() sets the function to check the revocation
146 status of the given certificate x against the given crl. This function
147 must return 0 on failure and 1 on success. If no function to get the
148 issuer is provided, the internal default function will be used instead.
149
150 X509_STORE_set_check_policy() sets the function to check the policies
151 of all the certificates in the final chain.. This function must return
152 0 on failure and 1 on success. If no function to get the issuer is
153 provided, the internal default function will be used instead.
154
155 X509_STORE_set_lookup_certs() and X509_STORE_set_lookup_crls() set the
156 functions to look up all the certs or all the CRLs that match the given
157 name nm. These functions return NULL on failure and a pointer to a
158 stack of certificates (X509) or to a stack of CRLs (X509_CRL) on
159 success. If no function to get the issuer is provided, the internal
160 default function will be used instead.
161
162 X509_STORE_set_cleanup() sets the final cleanup function, which is
163 called when the context (X509_STORE_CTX) is being torn down. This
164 function doesn't return any value. If no function to get the issuer is
165 provided, the internal default function will be used instead.
166
167 X509_STORE_get_verify_cb(), X509_STORE_CTX_get_verify(),
168 X509_STORE_get_get_issuer(), X509_STORE_get_check_issued(),
169 X509_STORE_get_check_revocation(), X509_STORE_get_get_crl(),
170 X509_STORE_get_check_crl(), X509_STORE_set_verify(),
171 X509_STORE_set_get_issuer(), X509_STORE_get_cert_crl(),
172 X509_STORE_get_check_policy(), X509_STORE_get_lookup_certs(),
173 X509_STORE_get_lookup_crls() and X509_STORE_get_cleanup() all return
174 the function pointer assigned with X509_STORE_set_check_issued(),
175 X509_STORE_set_check_revocation(), X509_STORE_set_get_crl(),
176 X509_STORE_set_check_crl(), X509_STORE_set_cert_crl(),
177 X509_STORE_set_check_policy(), X509_STORE_set_lookup_certs(),
178 X509_STORE_set_lookup_crls() and X509_STORE_set_cleanup(), or NULL if
179 no assignment has been made.
180
181 X509_STORE_set_verify_cb_func(), X509_STORE_set_verify_func() and
182 X509_STORE_set_lookup_crls_cb() are aliases for
183 X509_STORE_set_verify_cb(), X509_STORE_set_verify() and
184 X509_STORE_set_lookup_crls, available as macros for backward
185 compatibility.
186
188 All the callbacks from a X509_STORE are inherited by the corresponding
189 X509_STORE_CTX structure when it is initialized. See
190 X509_STORE_CTX_set_verify_cb(3) for further details.
191
193 The macro version of this function was the only one available before
194 OpenSSL 1.0.0.
195
197 The X509_STORE_set_*() functions do not return a value.
198
199 The X509_STORE_get_*() functions return a pointer of the appropriate
200 function type.
201
203 X509_STORE_CTX_set_verify_cb(3), X509_STORE_CTX_get0_chain(3),
204 X509_STORE_CTX_verify_cb(3), X509_STORE_CTX_verify_fn(3), CMS_verify(3)
205
207 The X509_STORE_set_verify_cb() function was added in OpenSSL 1.0.0.
208
209 The functions X509_STORE_set_verify_cb(), X509_STORE_get_verify_cb(),
210 X509_STORE_set_verify(), X509_STORE_CTX_get_verify(),
211 X509_STORE_set_get_issuer(), X509_STORE_get_get_issuer(),
212 X509_STORE_set_check_issued(), X509_STORE_get_check_issued(),
213 X509_STORE_set_check_revocation(), X509_STORE_get_check_revocation(),
214 X509_STORE_set_get_crl(), X509_STORE_get_get_crl(),
215 X509_STORE_set_check_crl(), X509_STORE_get_check_crl(),
216 X509_STORE_set_cert_crl(), X509_STORE_get_cert_crl(),
217 X509_STORE_set_check_policy(), X509_STORE_get_check_policy(),
218 X509_STORE_set_lookup_certs(), X509_STORE_get_lookup_certs(),
219 X509_STORE_set_lookup_crls(), X509_STORE_get_lookup_crls(),
220 X509_STORE_set_cleanup() and X509_STORE_get_cleanup() were added in
221 OpenSSL 1.1.0.
222
224 Copyright 2009-2016 The OpenSSL Project Authors. All Rights Reserved.
225
226 Licensed under the OpenSSL license (the "License"). You may not use
227 this file except in compliance with the License. You can obtain a copy
228 in the file LICENSE in the source distribution or at
229 <https://www.openssl.org/source/license.html>.
230
231
232
2331.1.1g 2020-04-23 X509_STORE_SET_VERIFY_CB_FUNC(3)