File indexing completed on 2025-01-18 10:05:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef OPENSSL_X509_VFY_H
0016 # define OPENSSL_X509_VFY_H
0017 # pragma once
0018
0019 # include <openssl/macros.h>
0020 # ifndef OPENSSL_NO_DEPRECATED_3_0
0021 # define HEADER_X509_VFY_H
0022 # endif
0023
0024
0025
0026
0027 # ifndef OPENSSL_X509_H
0028 # include <openssl/x509.h>
0029 # endif
0030
0031 # include <openssl/opensslconf.h>
0032 # include <openssl/lhash.h>
0033 # include <openssl/bio.h>
0034 # include <openssl/crypto.h>
0035 # include <openssl/symhacks.h>
0036
0037 #ifdef __cplusplus
0038 extern "C" {
0039 #endif
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 typedef enum {
0059 X509_LU_NONE = 0,
0060 X509_LU_X509, X509_LU_CRL
0061 } X509_LOOKUP_TYPE;
0062
0063 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
0064 #define X509_LU_RETRY -1
0065 #define X509_LU_FAIL 0
0066 #endif
0067
0068 SKM_DEFINE_STACK_OF_INTERNAL(X509_LOOKUP, X509_LOOKUP, X509_LOOKUP)
0069 #define sk_X509_LOOKUP_num(sk) OPENSSL_sk_num(ossl_check_const_X509_LOOKUP_sk_type(sk))
0070 #define sk_X509_LOOKUP_value(sk, idx) ((X509_LOOKUP *)OPENSSL_sk_value(ossl_check_const_X509_LOOKUP_sk_type(sk), (idx)))
0071 #define sk_X509_LOOKUP_new(cmp) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new(ossl_check_X509_LOOKUP_compfunc_type(cmp)))
0072 #define sk_X509_LOOKUP_new_null() ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_null())
0073 #define sk_X509_LOOKUP_new_reserve(cmp, n) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_new_reserve(ossl_check_X509_LOOKUP_compfunc_type(cmp), (n)))
0074 #define sk_X509_LOOKUP_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_LOOKUP_sk_type(sk), (n))
0075 #define sk_X509_LOOKUP_free(sk) OPENSSL_sk_free(ossl_check_X509_LOOKUP_sk_type(sk))
0076 #define sk_X509_LOOKUP_zero(sk) OPENSSL_sk_zero(ossl_check_X509_LOOKUP_sk_type(sk))
0077 #define sk_X509_LOOKUP_delete(sk, i) ((X509_LOOKUP *)OPENSSL_sk_delete(ossl_check_X509_LOOKUP_sk_type(sk), (i)))
0078 #define sk_X509_LOOKUP_delete_ptr(sk, ptr) ((X509_LOOKUP *)OPENSSL_sk_delete_ptr(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr)))
0079 #define sk_X509_LOOKUP_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
0080 #define sk_X509_LOOKUP_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
0081 #define sk_X509_LOOKUP_pop(sk) ((X509_LOOKUP *)OPENSSL_sk_pop(ossl_check_X509_LOOKUP_sk_type(sk)))
0082 #define sk_X509_LOOKUP_shift(sk) ((X509_LOOKUP *)OPENSSL_sk_shift(ossl_check_X509_LOOKUP_sk_type(sk)))
0083 #define sk_X509_LOOKUP_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_LOOKUP_sk_type(sk),ossl_check_X509_LOOKUP_freefunc_type(freefunc))
0084 #define sk_X509_LOOKUP_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), (idx))
0085 #define sk_X509_LOOKUP_set(sk, idx, ptr) ((X509_LOOKUP *)OPENSSL_sk_set(ossl_check_X509_LOOKUP_sk_type(sk), (idx), ossl_check_X509_LOOKUP_type(ptr)))
0086 #define sk_X509_LOOKUP_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
0087 #define sk_X509_LOOKUP_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr))
0088 #define sk_X509_LOOKUP_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_type(ptr), pnum)
0089 #define sk_X509_LOOKUP_sort(sk) OPENSSL_sk_sort(ossl_check_X509_LOOKUP_sk_type(sk))
0090 #define sk_X509_LOOKUP_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_LOOKUP_sk_type(sk))
0091 #define sk_X509_LOOKUP_dup(sk) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_dup(ossl_check_const_X509_LOOKUP_sk_type(sk)))
0092 #define sk_X509_LOOKUP_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_LOOKUP) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_copyfunc_type(copyfunc), ossl_check_X509_LOOKUP_freefunc_type(freefunc)))
0093 #define sk_X509_LOOKUP_set_cmp_func(sk, cmp) ((sk_X509_LOOKUP_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_LOOKUP_sk_type(sk), ossl_check_X509_LOOKUP_compfunc_type(cmp)))
0094 SKM_DEFINE_STACK_OF_INTERNAL(X509_OBJECT, X509_OBJECT, X509_OBJECT)
0095 #define sk_X509_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_X509_OBJECT_sk_type(sk))
0096 #define sk_X509_OBJECT_value(sk, idx) ((X509_OBJECT *)OPENSSL_sk_value(ossl_check_const_X509_OBJECT_sk_type(sk), (idx)))
0097 #define sk_X509_OBJECT_new(cmp) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new(ossl_check_X509_OBJECT_compfunc_type(cmp)))
0098 #define sk_X509_OBJECT_new_null() ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_null())
0099 #define sk_X509_OBJECT_new_reserve(cmp, n) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_X509_OBJECT_compfunc_type(cmp), (n)))
0100 #define sk_X509_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_OBJECT_sk_type(sk), (n))
0101 #define sk_X509_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_X509_OBJECT_sk_type(sk))
0102 #define sk_X509_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_X509_OBJECT_sk_type(sk))
0103 #define sk_X509_OBJECT_delete(sk, i) ((X509_OBJECT *)OPENSSL_sk_delete(ossl_check_X509_OBJECT_sk_type(sk), (i)))
0104 #define sk_X509_OBJECT_delete_ptr(sk, ptr) ((X509_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr)))
0105 #define sk_X509_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
0106 #define sk_X509_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
0107 #define sk_X509_OBJECT_pop(sk) ((X509_OBJECT *)OPENSSL_sk_pop(ossl_check_X509_OBJECT_sk_type(sk)))
0108 #define sk_X509_OBJECT_shift(sk) ((X509_OBJECT *)OPENSSL_sk_shift(ossl_check_X509_OBJECT_sk_type(sk)))
0109 #define sk_X509_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_OBJECT_sk_type(sk),ossl_check_X509_OBJECT_freefunc_type(freefunc))
0110 #define sk_X509_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), (idx))
0111 #define sk_X509_OBJECT_set(sk, idx, ptr) ((X509_OBJECT *)OPENSSL_sk_set(ossl_check_X509_OBJECT_sk_type(sk), (idx), ossl_check_X509_OBJECT_type(ptr)))
0112 #define sk_X509_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
0113 #define sk_X509_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr))
0114 #define sk_X509_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_type(ptr), pnum)
0115 #define sk_X509_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_X509_OBJECT_sk_type(sk))
0116 #define sk_X509_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_OBJECT_sk_type(sk))
0117 #define sk_X509_OBJECT_dup(sk) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_X509_OBJECT_sk_type(sk)))
0118 #define sk_X509_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_copyfunc_type(copyfunc), ossl_check_X509_OBJECT_freefunc_type(freefunc)))
0119 #define sk_X509_OBJECT_set_cmp_func(sk, cmp) ((sk_X509_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_OBJECT_sk_type(sk), ossl_check_X509_OBJECT_compfunc_type(cmp)))
0120 SKM_DEFINE_STACK_OF_INTERNAL(X509_VERIFY_PARAM, X509_VERIFY_PARAM, X509_VERIFY_PARAM)
0121 #define sk_X509_VERIFY_PARAM_num(sk) OPENSSL_sk_num(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
0122 #define sk_X509_VERIFY_PARAM_value(sk, idx) ((X509_VERIFY_PARAM *)OPENSSL_sk_value(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), (idx)))
0123 #define sk_X509_VERIFY_PARAM_new(cmp) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
0124 #define sk_X509_VERIFY_PARAM_new_null() ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_null())
0125 #define sk_X509_VERIFY_PARAM_new_reserve(cmp, n) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_new_reserve(ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp), (n)))
0126 #define sk_X509_VERIFY_PARAM_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (n))
0127 #define sk_X509_VERIFY_PARAM_free(sk) OPENSSL_sk_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
0128 #define sk_X509_VERIFY_PARAM_zero(sk) OPENSSL_sk_zero(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
0129 #define sk_X509_VERIFY_PARAM_delete(sk, i) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (i)))
0130 #define sk_X509_VERIFY_PARAM_delete_ptr(sk, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_delete_ptr(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr)))
0131 #define sk_X509_VERIFY_PARAM_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
0132 #define sk_X509_VERIFY_PARAM_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
0133 #define sk_X509_VERIFY_PARAM_pop(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_pop(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
0134 #define sk_X509_VERIFY_PARAM_shift(sk) ((X509_VERIFY_PARAM *)OPENSSL_sk_shift(ossl_check_X509_VERIFY_PARAM_sk_type(sk)))
0135 #define sk_X509_VERIFY_PARAM_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_VERIFY_PARAM_sk_type(sk),ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc))
0136 #define sk_X509_VERIFY_PARAM_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), (idx))
0137 #define sk_X509_VERIFY_PARAM_set(sk, idx, ptr) ((X509_VERIFY_PARAM *)OPENSSL_sk_set(ossl_check_X509_VERIFY_PARAM_sk_type(sk), (idx), ossl_check_X509_VERIFY_PARAM_type(ptr)))
0138 #define sk_X509_VERIFY_PARAM_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
0139 #define sk_X509_VERIFY_PARAM_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr))
0140 #define sk_X509_VERIFY_PARAM_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_type(ptr), pnum)
0141 #define sk_X509_VERIFY_PARAM_sort(sk) OPENSSL_sk_sort(ossl_check_X509_VERIFY_PARAM_sk_type(sk))
0142 #define sk_X509_VERIFY_PARAM_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk))
0143 #define sk_X509_VERIFY_PARAM_dup(sk) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_dup(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk)))
0144 #define sk_X509_VERIFY_PARAM_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_VERIFY_PARAM) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_copyfunc_type(copyfunc), ossl_check_X509_VERIFY_PARAM_freefunc_type(freefunc)))
0145 #define sk_X509_VERIFY_PARAM_set_cmp_func(sk, cmp) ((sk_X509_VERIFY_PARAM_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_VERIFY_PARAM_sk_type(sk), ossl_check_X509_VERIFY_PARAM_compfunc_type(cmp)))
0146
0147
0148
0149 typedef struct x509_trust_st {
0150 int trust;
0151 int flags;
0152 int (*check_trust) (struct x509_trust_st *, X509 *, int);
0153 char *name;
0154 int arg1;
0155 void *arg2;
0156 } X509_TRUST;
0157 SKM_DEFINE_STACK_OF_INTERNAL(X509_TRUST, X509_TRUST, X509_TRUST)
0158 #define sk_X509_TRUST_num(sk) OPENSSL_sk_num(ossl_check_const_X509_TRUST_sk_type(sk))
0159 #define sk_X509_TRUST_value(sk, idx) ((X509_TRUST *)OPENSSL_sk_value(ossl_check_const_X509_TRUST_sk_type(sk), (idx)))
0160 #define sk_X509_TRUST_new(cmp) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new(ossl_check_X509_TRUST_compfunc_type(cmp)))
0161 #define sk_X509_TRUST_new_null() ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_null())
0162 #define sk_X509_TRUST_new_reserve(cmp, n) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_new_reserve(ossl_check_X509_TRUST_compfunc_type(cmp), (n)))
0163 #define sk_X509_TRUST_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_TRUST_sk_type(sk), (n))
0164 #define sk_X509_TRUST_free(sk) OPENSSL_sk_free(ossl_check_X509_TRUST_sk_type(sk))
0165 #define sk_X509_TRUST_zero(sk) OPENSSL_sk_zero(ossl_check_X509_TRUST_sk_type(sk))
0166 #define sk_X509_TRUST_delete(sk, i) ((X509_TRUST *)OPENSSL_sk_delete(ossl_check_X509_TRUST_sk_type(sk), (i)))
0167 #define sk_X509_TRUST_delete_ptr(sk, ptr) ((X509_TRUST *)OPENSSL_sk_delete_ptr(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr)))
0168 #define sk_X509_TRUST_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
0169 #define sk_X509_TRUST_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
0170 #define sk_X509_TRUST_pop(sk) ((X509_TRUST *)OPENSSL_sk_pop(ossl_check_X509_TRUST_sk_type(sk)))
0171 #define sk_X509_TRUST_shift(sk) ((X509_TRUST *)OPENSSL_sk_shift(ossl_check_X509_TRUST_sk_type(sk)))
0172 #define sk_X509_TRUST_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_TRUST_sk_type(sk),ossl_check_X509_TRUST_freefunc_type(freefunc))
0173 #define sk_X509_TRUST_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), (idx))
0174 #define sk_X509_TRUST_set(sk, idx, ptr) ((X509_TRUST *)OPENSSL_sk_set(ossl_check_X509_TRUST_sk_type(sk), (idx), ossl_check_X509_TRUST_type(ptr)))
0175 #define sk_X509_TRUST_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
0176 #define sk_X509_TRUST_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr))
0177 #define sk_X509_TRUST_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_type(ptr), pnum)
0178 #define sk_X509_TRUST_sort(sk) OPENSSL_sk_sort(ossl_check_X509_TRUST_sk_type(sk))
0179 #define sk_X509_TRUST_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_TRUST_sk_type(sk))
0180 #define sk_X509_TRUST_dup(sk) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_dup(ossl_check_const_X509_TRUST_sk_type(sk)))
0181 #define sk_X509_TRUST_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_TRUST) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_copyfunc_type(copyfunc), ossl_check_X509_TRUST_freefunc_type(freefunc)))
0182 #define sk_X509_TRUST_set_cmp_func(sk, cmp) ((sk_X509_TRUST_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_TRUST_sk_type(sk), ossl_check_X509_TRUST_compfunc_type(cmp)))
0183
0184
0185
0186 # define X509_TRUST_DEFAULT 0
0187 # define X509_TRUST_COMPAT 1
0188 # define X509_TRUST_SSL_CLIENT 2
0189 # define X509_TRUST_SSL_SERVER 3
0190 # define X509_TRUST_EMAIL 4
0191 # define X509_TRUST_OBJECT_SIGN 5
0192 # define X509_TRUST_OCSP_SIGN 6
0193 # define X509_TRUST_OCSP_REQUEST 7
0194 # define X509_TRUST_TSA 8
0195
0196 # define X509_TRUST_MIN 1
0197 # define X509_TRUST_MAX 8
0198
0199
0200 # define X509_TRUST_DYNAMIC (1U << 0)
0201 # define X509_TRUST_DYNAMIC_NAME (1U << 1)
0202
0203 # define X509_TRUST_NO_SS_COMPAT (1U << 2)
0204
0205 # define X509_TRUST_DO_SS_COMPAT (1U << 3)
0206
0207 # define X509_TRUST_OK_ANY_EKU (1U << 4)
0208
0209
0210 # define X509_TRUST_TRUSTED 1
0211 # define X509_TRUST_REJECTED 2
0212 # define X509_TRUST_UNTRUSTED 3
0213
0214 int X509_TRUST_set(int *t, int trust);
0215 int X509_TRUST_get_count(void);
0216 X509_TRUST *X509_TRUST_get0(int idx);
0217 int X509_TRUST_get_by_id(int id);
0218 int X509_TRUST_add(int id, int flags, int (*ck) (X509_TRUST *, X509 *, int),
0219 const char *name, int arg1, void *arg2);
0220 void X509_TRUST_cleanup(void);
0221 int X509_TRUST_get_flags(const X509_TRUST *xp);
0222 char *X509_TRUST_get0_name(const X509_TRUST *xp);
0223 int X509_TRUST_get_trust(const X509_TRUST *xp);
0224
0225 int X509_trusted(const X509 *x);
0226 int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj);
0227 int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj);
0228 void X509_trust_clear(X509 *x);
0229 void X509_reject_clear(X509 *x);
0230 STACK_OF(ASN1_OBJECT) *X509_get0_trust_objects(X509 *x);
0231 STACK_OF(ASN1_OBJECT) *X509_get0_reject_objects(X509 *x);
0232
0233 int (*X509_TRUST_set_default(int (*trust) (int, X509 *, int))) (int, X509 *,
0234 int);
0235 int X509_check_trust(X509 *x, int id, int flags);
0236
0237 int X509_verify_cert(X509_STORE_CTX *ctx);
0238 int X509_STORE_CTX_verify(X509_STORE_CTX *ctx);
0239 STACK_OF(X509) *X509_build_chain(X509 *target, STACK_OF(X509) *certs,
0240 X509_STORE *store, int with_self_signed,
0241 OSSL_LIB_CTX *libctx, const char *propq);
0242
0243 int X509_STORE_set_depth(X509_STORE *store, int depth);
0244
0245 typedef int (*X509_STORE_CTX_verify_cb)(int, X509_STORE_CTX *);
0246 int X509_STORE_CTX_print_verify_cb(int ok, X509_STORE_CTX *ctx);
0247 typedef int (*X509_STORE_CTX_verify_fn)(X509_STORE_CTX *);
0248 typedef int (*X509_STORE_CTX_get_issuer_fn)(X509 **issuer,
0249 X509_STORE_CTX *ctx, X509 *x);
0250 typedef int (*X509_STORE_CTX_check_issued_fn)(X509_STORE_CTX *ctx,
0251 X509 *x, X509 *issuer);
0252 typedef int (*X509_STORE_CTX_check_revocation_fn)(X509_STORE_CTX *ctx);
0253 typedef int (*X509_STORE_CTX_get_crl_fn)(X509_STORE_CTX *ctx,
0254 X509_CRL **crl, X509 *x);
0255 typedef int (*X509_STORE_CTX_check_crl_fn)(X509_STORE_CTX *ctx, X509_CRL *crl);
0256 typedef int (*X509_STORE_CTX_cert_crl_fn)(X509_STORE_CTX *ctx,
0257 X509_CRL *crl, X509 *x);
0258 typedef int (*X509_STORE_CTX_check_policy_fn)(X509_STORE_CTX *ctx);
0259 typedef STACK_OF(X509)
0260 *(*X509_STORE_CTX_lookup_certs_fn)(X509_STORE_CTX *ctx,
0261 const X509_NAME *nm);
0262 typedef STACK_OF(X509_CRL)
0263 *(*X509_STORE_CTX_lookup_crls_fn)(const X509_STORE_CTX *ctx,
0264 const X509_NAME *nm);
0265 typedef int (*X509_STORE_CTX_cleanup_fn)(X509_STORE_CTX *ctx);
0266
0267 void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
0268
0269 # define X509_STORE_CTX_set_app_data(ctx,data) \
0270 X509_STORE_CTX_set_ex_data(ctx,0,data)
0271 # define X509_STORE_CTX_get_app_data(ctx) \
0272 X509_STORE_CTX_get_ex_data(ctx,0)
0273
0274 # define X509_L_FILE_LOAD 1
0275 # define X509_L_ADD_DIR 2
0276 # define X509_L_ADD_STORE 3
0277 # define X509_L_LOAD_STORE 4
0278
0279 # define X509_LOOKUP_load_file(x,name,type) \
0280 X509_LOOKUP_ctrl((x),X509_L_FILE_LOAD,(name),(long)(type),NULL)
0281
0282 # define X509_LOOKUP_add_dir(x,name,type) \
0283 X509_LOOKUP_ctrl((x),X509_L_ADD_DIR,(name),(long)(type),NULL)
0284
0285 # define X509_LOOKUP_add_store(x,name) \
0286 X509_LOOKUP_ctrl((x),X509_L_ADD_STORE,(name),0,NULL)
0287
0288 # define X509_LOOKUP_load_store(x,name) \
0289 X509_LOOKUP_ctrl((x),X509_L_LOAD_STORE,(name),0,NULL)
0290
0291 # define X509_LOOKUP_load_file_ex(x, name, type, libctx, propq) \
0292 X509_LOOKUP_ctrl_ex((x), X509_L_FILE_LOAD, (name), (long)(type), NULL,\
0293 (libctx), (propq))
0294
0295 # define X509_LOOKUP_load_store_ex(x, name, libctx, propq) \
0296 X509_LOOKUP_ctrl_ex((x), X509_L_LOAD_STORE, (name), 0, NULL, \
0297 (libctx), (propq))
0298
0299 # define X509_LOOKUP_add_store_ex(x, name, libctx, propq) \
0300 X509_LOOKUP_ctrl_ex((x), X509_L_ADD_STORE, (name), 0, NULL, \
0301 (libctx), (propq))
0302
0303 # define X509_V_OK 0
0304 # define X509_V_ERR_UNSPECIFIED 1
0305 # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT 2
0306 # define X509_V_ERR_UNABLE_TO_GET_CRL 3
0307 # define X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE 4
0308 # define X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE 5
0309 # define X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY 6
0310 # define X509_V_ERR_CERT_SIGNATURE_FAILURE 7
0311 # define X509_V_ERR_CRL_SIGNATURE_FAILURE 8
0312 # define X509_V_ERR_CERT_NOT_YET_VALID 9
0313 # define X509_V_ERR_CERT_HAS_EXPIRED 10
0314 # define X509_V_ERR_CRL_NOT_YET_VALID 11
0315 # define X509_V_ERR_CRL_HAS_EXPIRED 12
0316 # define X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD 13
0317 # define X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD 14
0318 # define X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD 15
0319 # define X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD 16
0320 # define X509_V_ERR_OUT_OF_MEM 17
0321 # define X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT 18
0322 # define X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN 19
0323 # define X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY 20
0324 # define X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE 21
0325 # define X509_V_ERR_CERT_CHAIN_TOO_LONG 22
0326 # define X509_V_ERR_CERT_REVOKED 23
0327 # define X509_V_ERR_NO_ISSUER_PUBLIC_KEY 24
0328 # define X509_V_ERR_PATH_LENGTH_EXCEEDED 25
0329 # define X509_V_ERR_INVALID_PURPOSE 26
0330 # define X509_V_ERR_CERT_UNTRUSTED 27
0331 # define X509_V_ERR_CERT_REJECTED 28
0332
0333
0334 # define X509_V_ERR_SUBJECT_ISSUER_MISMATCH 29
0335 # define X509_V_ERR_AKID_SKID_MISMATCH 30
0336 # define X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH 31
0337 # define X509_V_ERR_KEYUSAGE_NO_CERTSIGN 32
0338 # define X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER 33
0339 # define X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION 34
0340 # define X509_V_ERR_KEYUSAGE_NO_CRL_SIGN 35
0341 # define X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION 36
0342 # define X509_V_ERR_INVALID_NON_CA 37
0343 # define X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED 38
0344 # define X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE 39
0345 # define X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED 40
0346 # define X509_V_ERR_INVALID_EXTENSION 41
0347 # define X509_V_ERR_INVALID_POLICY_EXTENSION 42
0348 # define X509_V_ERR_NO_EXPLICIT_POLICY 43
0349 # define X509_V_ERR_DIFFERENT_CRL_SCOPE 44
0350 # define X509_V_ERR_UNSUPPORTED_EXTENSION_FEATURE 45
0351 # define X509_V_ERR_UNNESTED_RESOURCE 46
0352 # define X509_V_ERR_PERMITTED_VIOLATION 47
0353 # define X509_V_ERR_EXCLUDED_VIOLATION 48
0354 # define X509_V_ERR_SUBTREE_MINMAX 49
0355
0356 # define X509_V_ERR_APPLICATION_VERIFICATION 50
0357 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51
0358 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52
0359 # define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53
0360 # define X509_V_ERR_CRL_PATH_VALIDATION_ERROR 54
0361
0362 # define X509_V_ERR_PATH_LOOP 55
0363
0364 # define X509_V_ERR_SUITE_B_INVALID_VERSION 56
0365 # define X509_V_ERR_SUITE_B_INVALID_ALGORITHM 57
0366 # define X509_V_ERR_SUITE_B_INVALID_CURVE 58
0367 # define X509_V_ERR_SUITE_B_INVALID_SIGNATURE_ALGORITHM 59
0368 # define X509_V_ERR_SUITE_B_LOS_NOT_ALLOWED 60
0369 # define X509_V_ERR_SUITE_B_CANNOT_SIGN_P_384_WITH_P_256 61
0370
0371 # define X509_V_ERR_HOSTNAME_MISMATCH 62
0372 # define X509_V_ERR_EMAIL_MISMATCH 63
0373 # define X509_V_ERR_IP_ADDRESS_MISMATCH 64
0374
0375 # define X509_V_ERR_DANE_NO_MATCH 65
0376
0377 # define X509_V_ERR_EE_KEY_TOO_SMALL 66
0378 # define X509_V_ERR_CA_KEY_TOO_SMALL 67
0379 # define X509_V_ERR_CA_MD_TOO_WEAK 68
0380
0381 # define X509_V_ERR_INVALID_CALL 69
0382
0383 # define X509_V_ERR_STORE_LOOKUP 70
0384
0385 # define X509_V_ERR_NO_VALID_SCTS 71
0386
0387 # define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 72
0388
0389 # define X509_V_ERR_OCSP_VERIFY_NEEDED 73
0390 # define X509_V_ERR_OCSP_VERIFY_FAILED 74
0391 # define X509_V_ERR_OCSP_CERT_UNKNOWN 75
0392
0393 # define X509_V_ERR_UNSUPPORTED_SIGNATURE_ALGORITHM 76
0394 # define X509_V_ERR_SIGNATURE_ALGORITHM_MISMATCH 77
0395
0396
0397 # define X509_V_ERR_SIGNATURE_ALGORITHM_INCONSISTENCY 78
0398 # define X509_V_ERR_INVALID_CA 79
0399 # define X509_V_ERR_PATHLEN_INVALID_FOR_NON_CA 80
0400 # define X509_V_ERR_PATHLEN_WITHOUT_KU_KEY_CERT_SIGN 81
0401 # define X509_V_ERR_KU_KEY_CERT_SIGN_INVALID_FOR_NON_CA 82
0402 # define X509_V_ERR_ISSUER_NAME_EMPTY 83
0403 # define X509_V_ERR_SUBJECT_NAME_EMPTY 84
0404 # define X509_V_ERR_MISSING_AUTHORITY_KEY_IDENTIFIER 85
0405 # define X509_V_ERR_MISSING_SUBJECT_KEY_IDENTIFIER 86
0406 # define X509_V_ERR_EMPTY_SUBJECT_ALT_NAME 87
0407 # define X509_V_ERR_EMPTY_SUBJECT_SAN_NOT_CRITICAL 88
0408 # define X509_V_ERR_CA_BCONS_NOT_CRITICAL 89
0409 # define X509_V_ERR_AUTHORITY_KEY_IDENTIFIER_CRITICAL 90
0410 # define X509_V_ERR_SUBJECT_KEY_IDENTIFIER_CRITICAL 91
0411 # define X509_V_ERR_CA_CERT_MISSING_KEY_USAGE 92
0412 # define X509_V_ERR_EXTENSIONS_REQUIRE_VERSION_3 93
0413 # define X509_V_ERR_EC_KEY_EXPLICIT_PARAMS 94
0414 # define X509_V_ERR_RPK_UNTRUSTED 95
0415
0416
0417 # ifndef OPENSSL_NO_DEPRECATED_1_1_0
0418 # define X509_V_FLAG_CB_ISSUER_CHECK 0x0
0419 # endif
0420
0421 # define X509_V_FLAG_USE_CHECK_TIME 0x2
0422
0423 # define X509_V_FLAG_CRL_CHECK 0x4
0424
0425 # define X509_V_FLAG_CRL_CHECK_ALL 0x8
0426
0427 # define X509_V_FLAG_IGNORE_CRITICAL 0x10
0428
0429 # define X509_V_FLAG_X509_STRICT 0x20
0430
0431 # define X509_V_FLAG_ALLOW_PROXY_CERTS 0x40
0432
0433 # define X509_V_FLAG_POLICY_CHECK 0x80
0434
0435 # define X509_V_FLAG_EXPLICIT_POLICY 0x100
0436
0437 # define X509_V_FLAG_INHIBIT_ANY 0x200
0438
0439 # define X509_V_FLAG_INHIBIT_MAP 0x400
0440
0441 # define X509_V_FLAG_NOTIFY_POLICY 0x800
0442
0443 # define X509_V_FLAG_EXTENDED_CRL_SUPPORT 0x1000
0444
0445 # define X509_V_FLAG_USE_DELTAS 0x2000
0446
0447 # define X509_V_FLAG_CHECK_SS_SIGNATURE 0x4000
0448
0449 # define X509_V_FLAG_TRUSTED_FIRST 0x8000
0450
0451 # define X509_V_FLAG_SUITEB_128_LOS_ONLY 0x10000
0452
0453 # define X509_V_FLAG_SUITEB_192_LOS 0x20000
0454
0455 # define X509_V_FLAG_SUITEB_128_LOS 0x30000
0456
0457 # define X509_V_FLAG_PARTIAL_CHAIN 0x80000
0458
0459
0460
0461
0462
0463 # define X509_V_FLAG_NO_ALT_CHAINS 0x100000
0464
0465 # define X509_V_FLAG_NO_CHECK_TIME 0x200000
0466
0467 # define X509_VP_FLAG_DEFAULT 0x1
0468 # define X509_VP_FLAG_OVERWRITE 0x2
0469 # define X509_VP_FLAG_RESET_FLAGS 0x4
0470 # define X509_VP_FLAG_LOCKED 0x8
0471 # define X509_VP_FLAG_ONCE 0x10
0472
0473
0474 # define X509_V_FLAG_POLICY_MASK (X509_V_FLAG_POLICY_CHECK \
0475 | X509_V_FLAG_EXPLICIT_POLICY \
0476 | X509_V_FLAG_INHIBIT_ANY \
0477 | X509_V_FLAG_INHIBIT_MAP)
0478
0479 int X509_OBJECT_idx_by_subject(STACK_OF(X509_OBJECT) *h, X509_LOOKUP_TYPE type,
0480 const X509_NAME *name);
0481 X509_OBJECT *X509_OBJECT_retrieve_by_subject(STACK_OF(X509_OBJECT) *h,
0482 X509_LOOKUP_TYPE type,
0483 const X509_NAME *name);
0484 X509_OBJECT *X509_OBJECT_retrieve_match(STACK_OF(X509_OBJECT) *h,
0485 X509_OBJECT *x);
0486 int X509_OBJECT_up_ref_count(X509_OBJECT *a);
0487 X509_OBJECT *X509_OBJECT_new(void);
0488 void X509_OBJECT_free(X509_OBJECT *a);
0489 X509_LOOKUP_TYPE X509_OBJECT_get_type(const X509_OBJECT *a);
0490 X509 *X509_OBJECT_get0_X509(const X509_OBJECT *a);
0491 int X509_OBJECT_set1_X509(X509_OBJECT *a, X509 *obj);
0492 X509_CRL *X509_OBJECT_get0_X509_CRL(const X509_OBJECT *a);
0493 int X509_OBJECT_set1_X509_CRL(X509_OBJECT *a, X509_CRL *obj);
0494 X509_STORE *X509_STORE_new(void);
0495 void X509_STORE_free(X509_STORE *xs);
0496 int X509_STORE_lock(X509_STORE *xs);
0497 int X509_STORE_unlock(X509_STORE *xs);
0498 int X509_STORE_up_ref(X509_STORE *xs);
0499 STACK_OF(X509_OBJECT) *X509_STORE_get0_objects(const X509_STORE *xs);
0500 STACK_OF(X509_OBJECT) *X509_STORE_get1_objects(X509_STORE *xs);
0501 STACK_OF(X509) *X509_STORE_get1_all_certs(X509_STORE *xs);
0502 STACK_OF(X509) *X509_STORE_CTX_get1_certs(X509_STORE_CTX *xs,
0503 const X509_NAME *nm);
0504 STACK_OF(X509_CRL) *X509_STORE_CTX_get1_crls(const X509_STORE_CTX *st,
0505 const X509_NAME *nm);
0506 int X509_STORE_set_flags(X509_STORE *xs, unsigned long flags);
0507 int X509_STORE_set_purpose(X509_STORE *xs, int purpose);
0508 int X509_STORE_set_trust(X509_STORE *xs, int trust);
0509 int X509_STORE_set1_param(X509_STORE *xs, const X509_VERIFY_PARAM *pm);
0510 X509_VERIFY_PARAM *X509_STORE_get0_param(const X509_STORE *xs);
0511
0512 void X509_STORE_set_verify(X509_STORE *xs, X509_STORE_CTX_verify_fn verify);
0513 #define X509_STORE_set_verify_func(ctx, func) \
0514 X509_STORE_set_verify((ctx),(func))
0515 void X509_STORE_CTX_set_verify(X509_STORE_CTX *ctx,
0516 X509_STORE_CTX_verify_fn verify);
0517 X509_STORE_CTX_verify_fn X509_STORE_get_verify(const X509_STORE *xs);
0518 void X509_STORE_set_verify_cb(X509_STORE *xs,
0519 X509_STORE_CTX_verify_cb verify_cb);
0520 # define X509_STORE_set_verify_cb_func(ctx,func) \
0521 X509_STORE_set_verify_cb((ctx),(func))
0522 X509_STORE_CTX_verify_cb X509_STORE_get_verify_cb(const X509_STORE *xs);
0523 void X509_STORE_set_get_issuer(X509_STORE *xs,
0524 X509_STORE_CTX_get_issuer_fn get_issuer);
0525 X509_STORE_CTX_get_issuer_fn X509_STORE_get_get_issuer(const X509_STORE *xs);
0526 void X509_STORE_set_check_issued(X509_STORE *xs,
0527 X509_STORE_CTX_check_issued_fn check_issued);
0528 X509_STORE_CTX_check_issued_fn X509_STORE_get_check_issued(const X509_STORE *s);
0529 void X509_STORE_set_check_revocation(X509_STORE *xs,
0530 X509_STORE_CTX_check_revocation_fn check_revocation);
0531 X509_STORE_CTX_check_revocation_fn
0532 X509_STORE_get_check_revocation(const X509_STORE *xs);
0533 void X509_STORE_set_get_crl(X509_STORE *xs,
0534 X509_STORE_CTX_get_crl_fn get_crl);
0535 X509_STORE_CTX_get_crl_fn X509_STORE_get_get_crl(const X509_STORE *xs);
0536 void X509_STORE_set_check_crl(X509_STORE *xs,
0537 X509_STORE_CTX_check_crl_fn check_crl);
0538 X509_STORE_CTX_check_crl_fn X509_STORE_get_check_crl(const X509_STORE *xs);
0539 void X509_STORE_set_cert_crl(X509_STORE *xs,
0540 X509_STORE_CTX_cert_crl_fn cert_crl);
0541 X509_STORE_CTX_cert_crl_fn X509_STORE_get_cert_crl(const X509_STORE *xs);
0542 void X509_STORE_set_check_policy(X509_STORE *xs,
0543 X509_STORE_CTX_check_policy_fn check_policy);
0544 X509_STORE_CTX_check_policy_fn X509_STORE_get_check_policy(const X509_STORE *s);
0545 void X509_STORE_set_lookup_certs(X509_STORE *xs,
0546 X509_STORE_CTX_lookup_certs_fn lookup_certs);
0547 X509_STORE_CTX_lookup_certs_fn X509_STORE_get_lookup_certs(const X509_STORE *s);
0548 void X509_STORE_set_lookup_crls(X509_STORE *xs,
0549 X509_STORE_CTX_lookup_crls_fn lookup_crls);
0550 #define X509_STORE_set_lookup_crls_cb(ctx, func) \
0551 X509_STORE_set_lookup_crls((ctx), (func))
0552 X509_STORE_CTX_lookup_crls_fn X509_STORE_get_lookup_crls(const X509_STORE *xs);
0553 void X509_STORE_set_cleanup(X509_STORE *xs,
0554 X509_STORE_CTX_cleanup_fn cleanup);
0555 X509_STORE_CTX_cleanup_fn X509_STORE_get_cleanup(const X509_STORE *xs);
0556
0557 #define X509_STORE_get_ex_new_index(l, p, newf, dupf, freef) \
0558 CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE, l, p, newf, dupf, freef)
0559 int X509_STORE_set_ex_data(X509_STORE *xs, int idx, void *data);
0560 void *X509_STORE_get_ex_data(const X509_STORE *xs, int idx);
0561
0562 X509_STORE_CTX *X509_STORE_CTX_new_ex(OSSL_LIB_CTX *libctx, const char *propq);
0563 X509_STORE_CTX *X509_STORE_CTX_new(void);
0564
0565 int X509_STORE_CTX_get1_issuer(X509 **issuer, X509_STORE_CTX *ctx, X509 *x);
0566
0567 void X509_STORE_CTX_free(X509_STORE_CTX *ctx);
0568 int X509_STORE_CTX_init(X509_STORE_CTX *ctx, X509_STORE *trust_store,
0569 X509 *target, STACK_OF(X509) *untrusted);
0570 int X509_STORE_CTX_init_rpk(X509_STORE_CTX *ctx, X509_STORE *trust_store,
0571 EVP_PKEY* rpk);
0572 void X509_STORE_CTX_set0_trusted_stack(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
0573 void X509_STORE_CTX_cleanup(X509_STORE_CTX *ctx);
0574
0575 X509_STORE *X509_STORE_CTX_get0_store(const X509_STORE_CTX *ctx);
0576 X509 *X509_STORE_CTX_get0_cert(const X509_STORE_CTX *ctx);
0577 EVP_PKEY *X509_STORE_CTX_get0_rpk(const X509_STORE_CTX *ctx);
0578 STACK_OF(X509)* X509_STORE_CTX_get0_untrusted(const X509_STORE_CTX *ctx);
0579 void X509_STORE_CTX_set0_untrusted(X509_STORE_CTX *ctx, STACK_OF(X509) *sk);
0580 void X509_STORE_CTX_set_verify_cb(X509_STORE_CTX *ctx,
0581 X509_STORE_CTX_verify_cb verify);
0582 X509_STORE_CTX_verify_cb X509_STORE_CTX_get_verify_cb(const X509_STORE_CTX *ctx);
0583 X509_STORE_CTX_verify_fn X509_STORE_CTX_get_verify(const X509_STORE_CTX *ctx);
0584 X509_STORE_CTX_get_issuer_fn X509_STORE_CTX_get_get_issuer(const X509_STORE_CTX *ctx);
0585 X509_STORE_CTX_check_issued_fn X509_STORE_CTX_get_check_issued(const X509_STORE_CTX *ctx);
0586 X509_STORE_CTX_check_revocation_fn X509_STORE_CTX_get_check_revocation(const X509_STORE_CTX *ctx);
0587 void X509_STORE_CTX_set_get_crl(X509_STORE_CTX *ctx,
0588 X509_STORE_CTX_get_crl_fn get_crl);
0589 X509_STORE_CTX_get_crl_fn X509_STORE_CTX_get_get_crl(const X509_STORE_CTX *ctx);
0590 X509_STORE_CTX_check_crl_fn X509_STORE_CTX_get_check_crl(const X509_STORE_CTX *ctx);
0591 X509_STORE_CTX_cert_crl_fn X509_STORE_CTX_get_cert_crl(const X509_STORE_CTX *ctx);
0592 X509_STORE_CTX_check_policy_fn X509_STORE_CTX_get_check_policy(const X509_STORE_CTX *ctx);
0593 X509_STORE_CTX_lookup_certs_fn X509_STORE_CTX_get_lookup_certs(const X509_STORE_CTX *ctx);
0594 X509_STORE_CTX_lookup_crls_fn X509_STORE_CTX_get_lookup_crls(const X509_STORE_CTX *ctx);
0595 X509_STORE_CTX_cleanup_fn X509_STORE_CTX_get_cleanup(const X509_STORE_CTX *ctx);
0596
0597 #ifndef OPENSSL_NO_DEPRECATED_1_1_0
0598 # define X509_STORE_CTX_get_chain X509_STORE_CTX_get0_chain
0599 # define X509_STORE_CTX_set_chain X509_STORE_CTX_set0_untrusted
0600 # define X509_STORE_CTX_trusted_stack X509_STORE_CTX_set0_trusted_stack
0601 # define X509_STORE_get_by_subject X509_STORE_CTX_get_by_subject
0602 # define X509_STORE_get1_certs X509_STORE_CTX_get1_certs
0603 # define X509_STORE_get1_crls X509_STORE_CTX_get1_crls
0604
0605 # define X509_STORE_get1_cert X509_STORE_CTX_get1_certs
0606
0607 # define X509_STORE_get1_crl X509_STORE_CTX_get1_crls
0608 #endif
0609
0610 X509_LOOKUP *X509_STORE_add_lookup(X509_STORE *xs, X509_LOOKUP_METHOD *m);
0611 X509_LOOKUP_METHOD *X509_LOOKUP_hash_dir(void);
0612 X509_LOOKUP_METHOD *X509_LOOKUP_file(void);
0613 X509_LOOKUP_METHOD *X509_LOOKUP_store(void);
0614
0615 typedef int (*X509_LOOKUP_ctrl_fn)(X509_LOOKUP *ctx, int cmd, const char *argc,
0616 long argl, char **ret);
0617 typedef int (*X509_LOOKUP_ctrl_ex_fn)(
0618 X509_LOOKUP *ctx, int cmd, const char *argc, long argl, char **ret,
0619 OSSL_LIB_CTX *libctx, const char *propq);
0620
0621 typedef int (*X509_LOOKUP_get_by_subject_fn)(X509_LOOKUP *ctx,
0622 X509_LOOKUP_TYPE type,
0623 const X509_NAME *name,
0624 X509_OBJECT *ret);
0625 typedef int (*X509_LOOKUP_get_by_subject_ex_fn)(X509_LOOKUP *ctx,
0626 X509_LOOKUP_TYPE type,
0627 const X509_NAME *name,
0628 X509_OBJECT *ret,
0629 OSSL_LIB_CTX *libctx,
0630 const char *propq);
0631 typedef int (*X509_LOOKUP_get_by_issuer_serial_fn)(X509_LOOKUP *ctx,
0632 X509_LOOKUP_TYPE type,
0633 const X509_NAME *name,
0634 const ASN1_INTEGER *serial,
0635 X509_OBJECT *ret);
0636 typedef int (*X509_LOOKUP_get_by_fingerprint_fn)(X509_LOOKUP *ctx,
0637 X509_LOOKUP_TYPE type,
0638 const unsigned char* bytes,
0639 int len,
0640 X509_OBJECT *ret);
0641 typedef int (*X509_LOOKUP_get_by_alias_fn)(X509_LOOKUP *ctx,
0642 X509_LOOKUP_TYPE type,
0643 const char *str,
0644 int len,
0645 X509_OBJECT *ret);
0646
0647 X509_LOOKUP_METHOD *X509_LOOKUP_meth_new(const char *name);
0648 void X509_LOOKUP_meth_free(X509_LOOKUP_METHOD *method);
0649
0650 int X509_LOOKUP_meth_set_new_item(X509_LOOKUP_METHOD *method,
0651 int (*new_item) (X509_LOOKUP *ctx));
0652 int (*X509_LOOKUP_meth_get_new_item(const X509_LOOKUP_METHOD* method))
0653 (X509_LOOKUP *ctx);
0654
0655 int X509_LOOKUP_meth_set_free(X509_LOOKUP_METHOD *method,
0656 void (*free_fn) (X509_LOOKUP *ctx));
0657 void (*X509_LOOKUP_meth_get_free(const X509_LOOKUP_METHOD* method))
0658 (X509_LOOKUP *ctx);
0659
0660 int X509_LOOKUP_meth_set_init(X509_LOOKUP_METHOD *method,
0661 int (*init) (X509_LOOKUP *ctx));
0662 int (*X509_LOOKUP_meth_get_init(const X509_LOOKUP_METHOD* method))
0663 (X509_LOOKUP *ctx);
0664
0665 int X509_LOOKUP_meth_set_shutdown(X509_LOOKUP_METHOD *method,
0666 int (*shutdown) (X509_LOOKUP *ctx));
0667 int (*X509_LOOKUP_meth_get_shutdown(const X509_LOOKUP_METHOD* method))
0668 (X509_LOOKUP *ctx);
0669
0670 int X509_LOOKUP_meth_set_ctrl(X509_LOOKUP_METHOD *method,
0671 X509_LOOKUP_ctrl_fn ctrl_fn);
0672 X509_LOOKUP_ctrl_fn X509_LOOKUP_meth_get_ctrl(const X509_LOOKUP_METHOD *method);
0673
0674 int X509_LOOKUP_meth_set_get_by_subject(X509_LOOKUP_METHOD *method,
0675 X509_LOOKUP_get_by_subject_fn fn);
0676 X509_LOOKUP_get_by_subject_fn X509_LOOKUP_meth_get_get_by_subject(
0677 const X509_LOOKUP_METHOD *method);
0678
0679 int X509_LOOKUP_meth_set_get_by_issuer_serial(X509_LOOKUP_METHOD *method,
0680 X509_LOOKUP_get_by_issuer_serial_fn fn);
0681 X509_LOOKUP_get_by_issuer_serial_fn X509_LOOKUP_meth_get_get_by_issuer_serial(
0682 const X509_LOOKUP_METHOD *method);
0683
0684 int X509_LOOKUP_meth_set_get_by_fingerprint(X509_LOOKUP_METHOD *method,
0685 X509_LOOKUP_get_by_fingerprint_fn fn);
0686 X509_LOOKUP_get_by_fingerprint_fn X509_LOOKUP_meth_get_get_by_fingerprint(
0687 const X509_LOOKUP_METHOD *method);
0688
0689 int X509_LOOKUP_meth_set_get_by_alias(X509_LOOKUP_METHOD *method,
0690 X509_LOOKUP_get_by_alias_fn fn);
0691 X509_LOOKUP_get_by_alias_fn X509_LOOKUP_meth_get_get_by_alias(
0692 const X509_LOOKUP_METHOD *method);
0693
0694
0695 int X509_STORE_add_cert(X509_STORE *xs, X509 *x);
0696 int X509_STORE_add_crl(X509_STORE *xs, X509_CRL *x);
0697
0698 int X509_STORE_CTX_get_by_subject(const X509_STORE_CTX *vs,
0699 X509_LOOKUP_TYPE type,
0700 const X509_NAME *name, X509_OBJECT *ret);
0701 X509_OBJECT *X509_STORE_CTX_get_obj_by_subject(X509_STORE_CTX *vs,
0702 X509_LOOKUP_TYPE type,
0703 const X509_NAME *name);
0704
0705 int X509_LOOKUP_ctrl(X509_LOOKUP *ctx, int cmd, const char *argc,
0706 long argl, char **ret);
0707 int X509_LOOKUP_ctrl_ex(X509_LOOKUP *ctx, int cmd, const char *argc, long argl,
0708 char **ret, OSSL_LIB_CTX *libctx, const char *propq);
0709
0710 int X509_load_cert_file(X509_LOOKUP *ctx, const char *file, int type);
0711 int X509_load_cert_file_ex(X509_LOOKUP *ctx, const char *file, int type,
0712 OSSL_LIB_CTX *libctx, const char *propq);
0713 int X509_load_crl_file(X509_LOOKUP *ctx, const char *file, int type);
0714 int X509_load_cert_crl_file(X509_LOOKUP *ctx, const char *file, int type);
0715 int X509_load_cert_crl_file_ex(X509_LOOKUP *ctx, const char *file, int type,
0716 OSSL_LIB_CTX *libctx, const char *propq);
0717
0718 X509_LOOKUP *X509_LOOKUP_new(X509_LOOKUP_METHOD *method);
0719 void X509_LOOKUP_free(X509_LOOKUP *ctx);
0720 int X509_LOOKUP_init(X509_LOOKUP *ctx);
0721 int X509_LOOKUP_by_subject(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
0722 const X509_NAME *name, X509_OBJECT *ret);
0723 int X509_LOOKUP_by_subject_ex(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
0724 const X509_NAME *name, X509_OBJECT *ret,
0725 OSSL_LIB_CTX *libctx, const char *propq);
0726 int X509_LOOKUP_by_issuer_serial(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
0727 const X509_NAME *name,
0728 const ASN1_INTEGER *serial,
0729 X509_OBJECT *ret);
0730 int X509_LOOKUP_by_fingerprint(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
0731 const unsigned char *bytes, int len,
0732 X509_OBJECT *ret);
0733 int X509_LOOKUP_by_alias(X509_LOOKUP *ctx, X509_LOOKUP_TYPE type,
0734 const char *str, int len, X509_OBJECT *ret);
0735 int X509_LOOKUP_set_method_data(X509_LOOKUP *ctx, void *data);
0736 void *X509_LOOKUP_get_method_data(const X509_LOOKUP *ctx);
0737 X509_STORE *X509_LOOKUP_get_store(const X509_LOOKUP *ctx);
0738 int X509_LOOKUP_shutdown(X509_LOOKUP *ctx);
0739
0740 int X509_STORE_load_file(X509_STORE *xs, const char *file);
0741 int X509_STORE_load_path(X509_STORE *xs, const char *path);
0742 int X509_STORE_load_store(X509_STORE *xs, const char *store);
0743 int X509_STORE_load_locations(X509_STORE *s, const char *file, const char *dir);
0744 int X509_STORE_set_default_paths(X509_STORE *xs);
0745
0746 int X509_STORE_load_file_ex(X509_STORE *xs, const char *file,
0747 OSSL_LIB_CTX *libctx, const char *propq);
0748 int X509_STORE_load_store_ex(X509_STORE *xs, const char *store,
0749 OSSL_LIB_CTX *libctx, const char *propq);
0750 int X509_STORE_load_locations_ex(X509_STORE *xs,
0751 const char *file, const char *dir,
0752 OSSL_LIB_CTX *libctx, const char *propq);
0753 int X509_STORE_set_default_paths_ex(X509_STORE *xs,
0754 OSSL_LIB_CTX *libctx, const char *propq);
0755
0756 #define X509_STORE_CTX_get_ex_new_index(l, p, newf, dupf, freef) \
0757 CRYPTO_get_ex_new_index(CRYPTO_EX_INDEX_X509_STORE_CTX, l, p, newf, dupf, freef)
0758 int X509_STORE_CTX_set_ex_data(X509_STORE_CTX *ctx, int idx, void *data);
0759 void *X509_STORE_CTX_get_ex_data(const X509_STORE_CTX *ctx, int idx);
0760 int X509_STORE_CTX_get_error(const X509_STORE_CTX *ctx);
0761 void X509_STORE_CTX_set_error(X509_STORE_CTX *ctx, int s);
0762 int X509_STORE_CTX_get_error_depth(const X509_STORE_CTX *ctx);
0763 void X509_STORE_CTX_set_error_depth(X509_STORE_CTX *ctx, int depth);
0764 X509 *X509_STORE_CTX_get_current_cert(const X509_STORE_CTX *ctx);
0765 void X509_STORE_CTX_set_current_cert(X509_STORE_CTX *ctx, X509 *x);
0766 X509 *X509_STORE_CTX_get0_current_issuer(const X509_STORE_CTX *ctx);
0767 X509_CRL *X509_STORE_CTX_get0_current_crl(const X509_STORE_CTX *ctx);
0768 X509_STORE_CTX *X509_STORE_CTX_get0_parent_ctx(const X509_STORE_CTX *ctx);
0769 STACK_OF(X509) *X509_STORE_CTX_get0_chain(const X509_STORE_CTX *ctx);
0770 STACK_OF(X509) *X509_STORE_CTX_get1_chain(const X509_STORE_CTX *ctx);
0771 void X509_STORE_CTX_set_cert(X509_STORE_CTX *ctx, X509 *target);
0772 void X509_STORE_CTX_set0_rpk(X509_STORE_CTX *ctx, EVP_PKEY *target);
0773 void X509_STORE_CTX_set0_verified_chain(X509_STORE_CTX *c, STACK_OF(X509) *sk);
0774 void X509_STORE_CTX_set0_crls(X509_STORE_CTX *ctx, STACK_OF(X509_CRL) *sk);
0775 int X509_STORE_CTX_set_purpose(X509_STORE_CTX *ctx, int purpose);
0776 int X509_STORE_CTX_set_trust(X509_STORE_CTX *ctx, int trust);
0777 int X509_STORE_CTX_purpose_inherit(X509_STORE_CTX *ctx, int def_purpose,
0778 int purpose, int trust);
0779 void X509_STORE_CTX_set_flags(X509_STORE_CTX *ctx, unsigned long flags);
0780 void X509_STORE_CTX_set_time(X509_STORE_CTX *ctx, unsigned long flags,
0781 time_t t);
0782 void X509_STORE_CTX_set_current_reasons(X509_STORE_CTX *ctx,
0783 unsigned int current_reasons);
0784
0785 X509_POLICY_TREE *X509_STORE_CTX_get0_policy_tree(const X509_STORE_CTX *ctx);
0786 int X509_STORE_CTX_get_explicit_policy(const X509_STORE_CTX *ctx);
0787 int X509_STORE_CTX_get_num_untrusted(const X509_STORE_CTX *ctx);
0788
0789 X509_VERIFY_PARAM *X509_STORE_CTX_get0_param(const X509_STORE_CTX *ctx);
0790 void X509_STORE_CTX_set0_param(X509_STORE_CTX *ctx, X509_VERIFY_PARAM *param);
0791 int X509_STORE_CTX_set_default(X509_STORE_CTX *ctx, const char *name);
0792
0793
0794
0795
0796
0797 void X509_STORE_CTX_set0_dane(X509_STORE_CTX *ctx, SSL_DANE *dane);
0798 #define DANE_FLAG_NO_DANE_EE_NAMECHECKS (1L << 0)
0799
0800
0801
0802 X509_VERIFY_PARAM *X509_VERIFY_PARAM_new(void);
0803 void X509_VERIFY_PARAM_free(X509_VERIFY_PARAM *param);
0804 int X509_VERIFY_PARAM_inherit(X509_VERIFY_PARAM *to,
0805 const X509_VERIFY_PARAM *from);
0806 int X509_VERIFY_PARAM_set1(X509_VERIFY_PARAM *to,
0807 const X509_VERIFY_PARAM *from);
0808 int X509_VERIFY_PARAM_set1_name(X509_VERIFY_PARAM *param, const char *name);
0809 int X509_VERIFY_PARAM_set_flags(X509_VERIFY_PARAM *param,
0810 unsigned long flags);
0811 int X509_VERIFY_PARAM_clear_flags(X509_VERIFY_PARAM *param,
0812 unsigned long flags);
0813 unsigned long X509_VERIFY_PARAM_get_flags(const X509_VERIFY_PARAM *param);
0814 int X509_VERIFY_PARAM_set_purpose(X509_VERIFY_PARAM *param, int purpose);
0815 int X509_VERIFY_PARAM_set_trust(X509_VERIFY_PARAM *param, int trust);
0816 void X509_VERIFY_PARAM_set_depth(X509_VERIFY_PARAM *param, int depth);
0817 void X509_VERIFY_PARAM_set_auth_level(X509_VERIFY_PARAM *param, int auth_level);
0818 time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
0819 void X509_VERIFY_PARAM_set_time(X509_VERIFY_PARAM *param, time_t t);
0820 int X509_VERIFY_PARAM_add0_policy(X509_VERIFY_PARAM *param,
0821 ASN1_OBJECT *policy);
0822 int X509_VERIFY_PARAM_set1_policies(X509_VERIFY_PARAM *param,
0823 STACK_OF(ASN1_OBJECT) *policies);
0824
0825 int X509_VERIFY_PARAM_set_inh_flags(X509_VERIFY_PARAM *param,
0826 uint32_t flags);
0827 uint32_t X509_VERIFY_PARAM_get_inh_flags(const X509_VERIFY_PARAM *param);
0828
0829 char *X509_VERIFY_PARAM_get0_host(X509_VERIFY_PARAM *param, int idx);
0830 int X509_VERIFY_PARAM_set1_host(X509_VERIFY_PARAM *param,
0831 const char *name, size_t namelen);
0832 int X509_VERIFY_PARAM_add1_host(X509_VERIFY_PARAM *param,
0833 const char *name, size_t namelen);
0834 void X509_VERIFY_PARAM_set_hostflags(X509_VERIFY_PARAM *param,
0835 unsigned int flags);
0836 unsigned int X509_VERIFY_PARAM_get_hostflags(const X509_VERIFY_PARAM *param);
0837 char *X509_VERIFY_PARAM_get0_peername(const X509_VERIFY_PARAM *param);
0838 void X509_VERIFY_PARAM_move_peername(X509_VERIFY_PARAM *, X509_VERIFY_PARAM *);
0839 char *X509_VERIFY_PARAM_get0_email(X509_VERIFY_PARAM *param);
0840 int X509_VERIFY_PARAM_set1_email(X509_VERIFY_PARAM *param,
0841 const char *email, size_t emaillen);
0842 char *X509_VERIFY_PARAM_get1_ip_asc(X509_VERIFY_PARAM *param);
0843 int X509_VERIFY_PARAM_set1_ip(X509_VERIFY_PARAM *param,
0844 const unsigned char *ip, size_t iplen);
0845 int X509_VERIFY_PARAM_set1_ip_asc(X509_VERIFY_PARAM *param,
0846 const char *ipasc);
0847
0848 int X509_VERIFY_PARAM_get_depth(const X509_VERIFY_PARAM *param);
0849 int X509_VERIFY_PARAM_get_auth_level(const X509_VERIFY_PARAM *param);
0850 const char *X509_VERIFY_PARAM_get0_name(const X509_VERIFY_PARAM *param);
0851
0852 int X509_VERIFY_PARAM_add0_table(X509_VERIFY_PARAM *param);
0853 int X509_VERIFY_PARAM_get_count(void);
0854 const X509_VERIFY_PARAM *X509_VERIFY_PARAM_get0(int id);
0855 const X509_VERIFY_PARAM *X509_VERIFY_PARAM_lookup(const char *name);
0856 void X509_VERIFY_PARAM_table_cleanup(void);
0857
0858
0859 #define X509_PCY_TREE_FAILURE -2
0860 #define X509_PCY_TREE_INVALID -1
0861 #define X509_PCY_TREE_INTERNAL 0
0862
0863
0864
0865
0866
0867 #define X509_PCY_TREE_VALID 1
0868 #define X509_PCY_TREE_EMPTY 2
0869 #define X509_PCY_TREE_EXPLICIT 4
0870
0871 int X509_policy_check(X509_POLICY_TREE **ptree, int *pexplicit_policy,
0872 STACK_OF(X509) *certs,
0873 STACK_OF(ASN1_OBJECT) *policy_oids, unsigned int flags);
0874
0875 void X509_policy_tree_free(X509_POLICY_TREE *tree);
0876
0877 int X509_policy_tree_level_count(const X509_POLICY_TREE *tree);
0878 X509_POLICY_LEVEL *X509_policy_tree_get0_level(const X509_POLICY_TREE *tree,
0879 int i);
0880
0881 STACK_OF(X509_POLICY_NODE)
0882 *X509_policy_tree_get0_policies(const X509_POLICY_TREE *tree);
0883
0884 STACK_OF(X509_POLICY_NODE)
0885 *X509_policy_tree_get0_user_policies(const X509_POLICY_TREE *tree);
0886
0887 int X509_policy_level_node_count(X509_POLICY_LEVEL *level);
0888
0889 X509_POLICY_NODE *X509_policy_level_get0_node(const X509_POLICY_LEVEL *level,
0890 int i);
0891
0892 const ASN1_OBJECT *X509_policy_node_get0_policy(const X509_POLICY_NODE *node);
0893
0894 STACK_OF(POLICYQUALINFO)
0895 *X509_policy_node_get0_qualifiers(const X509_POLICY_NODE *node);
0896 const X509_POLICY_NODE
0897 *X509_policy_node_get0_parent(const X509_POLICY_NODE *node);
0898
0899 #ifdef __cplusplus
0900 }
0901 #endif
0902 #endif