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, libressl))] {
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    pub fn X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM;
92    pub fn X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM);
93
94    pub fn X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
95    pub fn X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int;
96
97    pub fn X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t);
98
99    pub fn X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int);
100}
101const_ptr_api! {
102    extern "C" {
103        pub fn X509_VERIFY_PARAM_get_flags(param: #[const_ptr_if(ossl300)] X509_VERIFY_PARAM) -> c_ulong;
104    }
105}
106
107extern "C" {
108    pub fn X509_VERIFY_PARAM_set1_host(
109        param: *mut X509_VERIFY_PARAM,
110        name: *const c_char,
111        namelen: size_t,
112    ) -> c_int;
113    pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint);
114    pub fn X509_VERIFY_PARAM_set1_email(
115        param: *mut X509_VERIFY_PARAM,
116        email: *const c_char,
117        emaillen: size_t,
118    ) -> c_int;
119    pub fn X509_VERIFY_PARAM_set1_ip(
120        param: *mut X509_VERIFY_PARAM,
121        ip: *const c_uchar,
122        iplen: size_t,
123    ) -> c_int;
124    #[cfg(ossl110)]
125    pub fn X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int);
126    #[cfg(ossl110)]
127    pub fn X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int;
128    pub fn X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int;
129}