1 use super::super::*; 2 use libc::*; 3 4 #[cfg(any(libressl, all(ossl102, not(ossl110))))] 5 pub enum X509_VERIFY_PARAM_ID {} 6 7 extern "C" { 8 #[cfg(ossl110)] X509_LOOKUP_meth_free(method: *mut X509_LOOKUP_METHOD)9 pub fn X509_LOOKUP_meth_free(method: *mut X509_LOOKUP_METHOD); 10 } 11 12 extern "C" { X509_LOOKUP_free(ctx: *mut X509_LOOKUP)13 pub fn X509_LOOKUP_free(ctx: *mut X509_LOOKUP); X509_LOOKUP_hash_dir() -> *mut X509_LOOKUP_METHOD14 pub fn X509_LOOKUP_hash_dir() -> *mut X509_LOOKUP_METHOD; X509_LOOKUP_file() -> *mut X509_LOOKUP_METHOD15 pub fn X509_LOOKUP_file() -> *mut X509_LOOKUP_METHOD; X509_LOOKUP_ctrl( ctx: *mut X509_LOOKUP, cmd: c_int, argc: *const c_char, argl: c_long, ret: *mut *mut c_char, ) -> c_int16 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; X509_load_cert_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int23 pub fn X509_load_cert_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int; X509_load_crl_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int24 pub fn X509_load_crl_file(ctx: *mut X509_LOOKUP, file: *const c_char, _type: c_int) -> c_int; 25 } 26 27 extern "C" { X509_STORE_new() -> *mut X509_STORE28 pub fn X509_STORE_new() -> *mut X509_STORE; X509_STORE_free(store: *mut X509_STORE)29 pub fn X509_STORE_free(store: *mut X509_STORE); 30 X509_STORE_CTX_new() -> *mut X509_STORE_CTX31 pub fn X509_STORE_CTX_new() -> *mut X509_STORE_CTX; 32 X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX)33 pub fn X509_STORE_CTX_free(ctx: *mut X509_STORE_CTX); X509_STORE_CTX_init( ctx: *mut X509_STORE_CTX, store: *mut X509_STORE, x509: *mut X509, chain: *mut stack_st_X509, ) -> c_int34 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; X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX)40 pub fn X509_STORE_CTX_cleanup(ctx: *mut X509_STORE_CTX); 41 X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int42 pub fn X509_STORE_add_cert(store: *mut X509_STORE, x: *mut X509) -> c_int; 43 X509_STORE_add_lookup( store: *mut X509_STORE, meth: *mut X509_LOOKUP_METHOD, ) -> *mut X509_LOOKUP44 pub fn X509_STORE_add_lookup( 45 store: *mut X509_STORE, 46 meth: *mut X509_LOOKUP_METHOD, 47 ) -> *mut X509_LOOKUP; 48 X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int49 pub fn X509_STORE_set_default_paths(store: *mut X509_STORE) -> c_int; X509_STORE_set_flags(store: *mut X509_STORE, flags: c_ulong) -> c_int50 pub fn X509_STORE_set_flags(store: *mut X509_STORE, flags: c_ulong) -> c_int; X509_STORE_set_purpose(ctx: *mut X509_STORE, purpose: c_int) -> c_int51 pub fn X509_STORE_set_purpose(ctx: *mut X509_STORE, purpose: c_int) -> c_int; X509_STORE_set_trust(ctx: *mut X509_STORE, trust: c_int) -> c_int52 pub fn X509_STORE_set_trust(ctx: *mut X509_STORE, trust: c_int) -> c_int; 53 54 } 55 56 const_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 62 const_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 } 70 extern "C" { X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int)71 pub fn X509_STORE_CTX_set_error(ctx: *mut X509_STORE_CTX, error: c_int); 72 } 73 cfg_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 87 extern "C" { 88 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM89 pub fn X509_VERIFY_PARAM_new() -> *mut X509_VERIFY_PARAM; 90 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM)91 pub fn X509_VERIFY_PARAM_free(param: *mut X509_VERIFY_PARAM); 92 93 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int94 pub fn X509_VERIFY_PARAM_set_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int; 95 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int96 pub fn X509_VERIFY_PARAM_clear_flags(param: *mut X509_VERIFY_PARAM, flags: c_ulong) -> c_int; 97 98 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t)99 pub fn X509_VERIFY_PARAM_set_time(param: *mut X509_VERIFY_PARAM, t: time_t); 100 101 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int)102 pub fn X509_VERIFY_PARAM_set_depth(param: *mut X509_VERIFY_PARAM, depth: c_int); 103 } 104 const_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 111 extern "C" { 112 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_set1_host( param: *mut X509_VERIFY_PARAM, name: *const c_char, namelen: size_t, ) -> c_int113 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))] X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint)119 pub fn X509_VERIFY_PARAM_set_hostflags(param: *mut X509_VERIFY_PARAM, flags: c_uint); 120 #[cfg(any(ossl102, libressl261))] X509_VERIFY_PARAM_set1_ip( param: *mut X509_VERIFY_PARAM, ip: *const c_uchar, iplen: size_t, ) -> c_int121 pub fn X509_VERIFY_PARAM_set1_ip( 122 param: *mut X509_VERIFY_PARAM, 123 ip: *const c_uchar, 124 iplen: size_t, 125 ) -> c_int; 126 #[cfg(ossl110)] X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int)127 pub fn X509_VERIFY_PARAM_set_auth_level(param: *mut X509_VERIFY_PARAM, lvl: c_int); 128 #[cfg(ossl110)] X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int129 pub fn X509_VERIFY_PARAM_get_auth_level(param: *const X509_VERIFY_PARAM) -> c_int; 130 #[cfg(ossl102)] X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int131 pub fn X509_VERIFY_PARAM_set_purpose(param: *mut X509_VERIFY_PARAM, purpose: c_int) -> c_int; 132 } 133