65#ifndef HEADER_X509_VFY_H
66#define HEADER_X509_VFY_H
76typedef struct x509_hash_dir_st
84typedef struct x509_file_st
110#define X509_LU_RETRY -1
111#define X509_LU_FAIL 0
112#define X509_LU_X509 1
114#define X509_LU_PKEY 3
116typedef struct x509_object_st
128typedef struct x509_lookup_st X509_LOOKUP;
133typedef struct x509_lookup_method_st
136 int (*new_item)(X509_LOOKUP *ctx);
137 void (*
free)(X509_LOOKUP *ctx);
138 int (*init)(X509_LOOKUP *ctx);
140 int (*ctrl)(X509_LOOKUP *ctx,
int cmd,
const char *argc,
long argl,
142 int (*get_by_subject)(X509_LOOKUP *ctx,
int type,
X509_NAME *name,
144 int (*get_by_issuer_serial)(X509_LOOKUP *ctx,
int type,
X509_NAME *name,
146 int (*get_by_fingerprint)(X509_LOOKUP *ctx,
int type,
147 unsigned char *bytes,
int len,
149 int (*get_by_alias)(X509_LOOKUP *ctx,
int type,
char *str,
int len,
151 } X509_LOOKUP_METHOD;
153typedef struct x509_store_state_st X509_STORE_CTX;
158typedef struct x509_store_st
169 STACK_OF(X509_LOOKUP) *get_cert_methods;
170 int (*verify)(X509_STORE_CTX *ctx);
171 int (*verify_cb)(
int ok,X509_STORE_CTX *ctx);
178#define X509_STORE_set_depth(ctx,d) ((ctx)->depth=(d))
180#define X509_STORE_set_verify_cb_func(ctx,func) ((ctx)->verify_cb=(func))
181#define X509_STORE_set_verify_func(ctx,func) ((ctx)->verify=(func))
188 X509_LOOKUP_METHOD *method;
191 X509_STORE *store_ctx;
197struct x509_store_state_st
222#define X509_STORE_CTX_set_depth(ctx,d) ((ctx)->depth=(d))
224#define X509_STORE_CTX_set_app_data(ctx,data) \
225 X509_STORE_CTX_set_ex_data(ctx,0,data)
226#define X509_STORE_CTX_get_app_data(ctx) \
227 X509_STORE_CTX_get_ex_data(ctx,0)
229#define X509_L_FILE_LOAD 1
230#define X509_L_ADD_DIR 2
232#define X509_LOOKUP_load_file(x,name,type) \
233 X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
235#define X509_LOOKUP_add_dir(x,name,type) \
236 X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
241#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
242#define X509_V_ERR_UNABLE_TO_GET_CRL 3
243#define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
244#define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
245#define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
246#define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
247#define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
248#define X509_V_ERR_CERT_NOT_YET_VALID 9
249#define X509_V_ERR_CERT_HAS_EXPIRED 10
250#define X509_V_ERR_CRL_NOT_YET_VALID 11
251#define X509_V_ERR_CRL_HAS_EXPIRED 12
252#define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
253#define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
254#define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
255#define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
256#define X509_V_ERR_OUT_OF_MEM 17
257#define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
258#define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
259#define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
260#define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
261#define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
262#define X509_V_ERR_CERT_REVOKED 23
263#define X509_V_ERR_INVALID_CA 24
264#define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
265#define X509_V_ERR_INVALID_PURPOSE 26
266#define X509_V_ERR_CERT_UNTRUSTED 27
267#define X509_V_ERR_CERT_REJECTED 28
270#define X509_V_ERR_APPLICATION_VERIFICATION 50
277#undef X509v3_cleanup_extensions
278#define X509v3_cleanup_extensions oX509v3_cleanup_extensions
279#undef X509v3_add_extension
280#define X509v3_add_extension oX509v3_add_extension
281#undef X509v3_add_netscape_extensions
282#define X509v3_add_netscape_extensions oX509v3_add_netscape_extensions
283#undef X509v3_add_standard_extensions
284#define X509v3_add_standard_extensions oX509v3_add_standard_extensions
288X509_OBJECT *X509_OBJECT_retrieve_by_subject(
LHASH *h,
int type,
X509_NAME *name);
290void X509_OBJECT_up_ref_count(X509_OBJECT *a);
291void X509_OBJECT_free_contents(X509_OBJECT *a);
292X509_STORE *X509_STORE_new(
void );
293void X509_STORE_free(X509_STORE *v);
295X509_STORE_CTX *X509_STORE_CTX_new(
void);
296void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
297void X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *store,
299void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
301X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *v, X509_LOOKUP_METHOD *m);
303X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(
void);
304X509_LOOKUP_METHOD *X509_LOOKUP_file(
void);
306int X509_STORE_add_cert(X509_STORE *ctx,
X509 *x);
307int X509_STORE_add_crl(X509_STORE *ctx,
X509_CRL *x);
309int X509_STORE_get_by_subject(X509_STORE_CTX *vs,
int type,
X509_NAME *name,
312int X509_LOOKUP_ctrl(X509_LOOKUP *ctx,
int cmd,
const char *argc,
313 long argl,
char **ret);
316int X509_load_cert_file(X509_LOOKUP *ctx,
const char *file,
int type);
317int X509_load_crl_file(X509_LOOKUP *ctx,
const char *file,
int type);
318int X509_load_cert_crl_file(X509_LOOKUP *ctx,
const char *file,
int type);
322X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
323void X509_LOOKUP_free(X509_LOOKUP *ctx);
324int X509_LOOKUP_init(X509_LOOKUP *ctx);
325int X509_LOOKUP_by_subject(X509_LOOKUP *ctx,
int type,
X509_NAME *name,
327int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx,
int type,
X509_NAME *name,
329int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx,
int type,
330 unsigned char *bytes,
int len, X509_OBJECT *ret);
331int X509_LOOKUP_by_alias(X509_LOOKUP *ctx,
int type,
char *str,
332 int len, X509_OBJECT *ret);
333int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
336int X509_STORE_load_locations (X509_STORE *ctx,
337 const char *file,
const char *dir);
338int X509_STORE_set_default_paths(X509_STORE *ctx);
341int X509_STORE_CTX_get_ex_new_index(
long argl,
void *argp,
CRYPTO_EX_new *new_func,
343int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx,
int idx,
void *data);
344void * X509_STORE_CTX_get_ex_data(X509_STORE_CTX *ctx,
int idx);
345int X509_STORE_CTX_get_error(X509_STORE_CTX *ctx);
346void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx,
int s);
347int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *ctx);
348X509 * X509_STORE_CTX_get_current_cert(X509_STORE_CTX *ctx);
349STACK_OF(
X509) *X509_STORE_CTX_get_chain(X509_STORE_CTX *ctx);
350STACK_OF(
X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *ctx);
351void X509_STORE_CTX_set_cert(X509_STORE_CTX *c,
X509 *x);
352void X509_STORE_CTX_set_chain(X509_STORE_CTX *c,
STACK_OF(
X509) *sk);
353int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx,
int purpose);
354int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx,
int trust);
355int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx,
int def_purpose,
356 int purpose,
int trust);
int CRYPTO_EX_dup(CRYPTO_EX_DATA *to, CRYPTO_EX_DATA *from, void *from_d, int idx, long argl, void *argp)
int CRYPTO_EX_new(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
void CRYPTO_EX_free(void *parent, void *ptr, CRYPTO_EX_DATA *ad, int idx, long argl, void *argp)
int shutdown(int socket, int how)
Shutdown.
void free(void *ptr)
Deallocate memory block.
#define DECLARE_STACK_OF(type)