1use super::super::*;
2use libc::*;
3
4#[cfg(any(libressl, all(ossl102, not(ossl110))))]
5pub enum X509_VERIFY_PARAM_ID {}
6
7extern "C" {
8 #[cfg(ossl110)]
9 pub fn X509_LOOKUP_meth_free(method: *mut X509_LOOKUP_METHOD);
10}
11
12extern "C" {
13 pub fn X509_LOOKUP_free(ctx: *mut X509_LOOKUP);
14 pub fn X509_LOOKUP_hash_dir() -> *mut X509_LOOKUP_METHOD;
15 pub fn X509_LOOKUP_file() -> *mut X509_LOOKUP_METHOD;
16 pub fn X509_LOOKUP_ctrl(
17 ctx: *mut X509_LOOKUP,
18 cmd: c_int,
19 argc: *const c_char,
20 argl: c_long,
21 ret: *mut *mut c_char,
22 ) -> c_int;
23 pub fn X509_load_cert_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
24 pub fn X509_load_crl_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int;
25}
26
27extern "C" {
28 pub fn X509_STORE_new() -> *mut X509_STORE;
29 pub fn X509_STORE_free(store: *mut X509_STORE);
30
31 pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX;
32
33 pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX);
34 pub fn X509_STORE_CTX_init(
35 ctx: *mut X509_STORE_CTX,
36 store: *mut X509_STORE,
37 x509: *mut X509,
38 chain: *mut stack_st_X509,
39 ) -> c_int;
40 pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX);
41
42 pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int;
43
44 pub fn X509_STORE_add_lookup(
45 store: *mut X509_STORE,
46 meth: *mut X509_LOOKUP_METHOD,
47 ) -> *mut X509_LOOKUP;
48
49 pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int;
50 pub fn X509_STORE_set_flags(store: *mut X509_STORE, flags: c_ulong) -> c_int;
51 pub fn X509_STORE_set_purpose(ctx: *mut X509_STORE, purpose: c_int) -> c_int;
52 pub fn X509_STORE_set_trust(ctx: *mut X509_STORE, trust: c_int) -> c_int;
53
54}
55
56const_ptr_api! {
57 extern "C" {
58 pub fn X509_STORE_set1_param(store: *mut X509_STORE, pm: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_int;
59 }
60}
61
62const_ptr_api! {
63 extern "C" {
64 pub fn X509_STORE_CTX_get_ex_data(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX, idx: c_int) -> *mut c_void;
65 pub fn X509_STORE_CTX_get_error(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
66 pub fn X509_STORE_CTX_get_error_depth(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> c_int;
67 pub fn X509_STORE_CTX_get_current_cert(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut X509;
68 }
69}
70extern "C" {
71 pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int);
72}
73cfg_if! {
74 if #[cfg(any(ossl110, libressl350))] {
75 const_ptr_api! {
76 extern "C" {
77 pub fn X509_STORE_CTX_get0_chain(ctx: #[const_ptr_if(ossl300)] X509_STORE_CTX) -> *mut stack_st_X509;
78 }
79 }
80 } else {
81 extern "C" {
82 pub fn X509_STORE_CTX_get_chain(ctx: *mut X509_STORE_CTX) -> *mut stack_st_X509;
83 }
84 }
85}
86
87extern "C" {
88 #[cfg(any(ossl102, libressl261))]
89 pub fn X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM;
90 #[cfg(any(ossl102, libressl261))]
91 pub fn X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM);
92
93 #[cfg(any(ossl102, libressl261))]
94 pub fn X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
95 #[cfg(any(ossl102, libressl261))]
96 pub fn X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
97
98 #[cfg(any(ossl102, libressl261))]
99 pub fn X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t);
100
101 #[cfg(any(ossl102, libressl261))]
102 pub fn X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int);
103}
104const_ptr_api! {
105 extern "C" {
106 #[cfg(any(ossl102, libressl261))]
107 pub fn X509_VERIFY_PARAM_get_flags(param: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_ulong;
108 }
109}
110
111extern "C" {
112 #[cfg(any(ossl102, libressl261))]
113 pub fn X509_VERIFY_PARAM_set1_host(
114 param: *mut X509_VERIFY_PARAM,
115 name: *const c_char,
116 namelen: size_t,
117 ) -> c_int;
118 #[cfg(any(ossl102, libressl261))]
119 pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint);
120 #[cfg(any(ossl102, libressl261))]
121 pub fn X509_VERIFY_PARAM_set1_email(
122 param: *mut X509_VERIFY_PARAM,
123 email: *const c_char,
124 emaillen: size_t,
125 ) -> c_int;
126 #[cfg(any(ossl102, libressl261))]
127 pub fn X509_VERIFY_PARAM_set1_ip(
128 param: *mut X509_VERIFY_PARAM,
129 ip: *const c_uchar,
130 iplen: size_t,
131 ) -> c_int;
132 #[cfg(ossl110)]
133 pub fn X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int);
134 #[cfg(ossl110)]
135 pub fn X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int;
136 #[cfg(ossl102)]
137 pub fn X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int;
138}
139