openssl_sys/handwritten/
x509_vfy.rs

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