| 1 |
use super::super::*; |
| 2 |
use libc::size_t; |
| 3 |
use std::ffi::{c_char, c_int, c_long, c_ulong, c_void}; |
| 4 |
|
| 5 |
stack!(stack_st_void); |
| 6 |
|
| 7 |
extern "C" { |
| 8 |
pub fn OpenSSL_version_num() -> c_ulong; |
| 9 |
pub fn OpenSSL_version(key: c_int) -> *const c_char; |
| 10 |
} |
| 11 |
|
| 12 |
extern "C" { |
| 13 |
pub fn CRYPTO_get_ex_new_index( |
| 14 |
class_index: c_int, |
| 15 |
argl: c_long, |
| 16 |
argp: *mut c_void, |
| 17 |
new_func: Option<CRYPTO_EX_new>, |
| 18 |
dup_func: Option<CRYPTO_EX_dup>, |
| 19 |
free_func: Option<CRYPTO_EX_free>, |
| 20 |
) -> c_int; |
| 21 |
|
| 22 |
#[cfg(not(ossl110))] |
| 23 |
pub fn CRYPTO_num_locks() -> c_int; |
| 24 |
} |
| 25 |
|
| 26 |
#[allow(clashing_extern_declarations)] |
| 27 |
extern "C" { |
| 28 |
#[cfg(not(ossl110))] |
| 29 |
#[link_name = "CRYPTO_set_locking_callback"] |
| 30 |
pub fn CRYPTO_set_locking_callback__fixed_rust( |
| 31 |
func: Option<unsafe extern "C" fn(mode: c_int, n: c_int, file: *const c_char, line: c_int)>, |
| 32 |
); |
| 33 |
|
| 34 |
#[cfg(not(ossl110))] |
| 35 |
#[link_name = "CRYPTO_set_id_callback"] |
| 36 |
pub fn CRYPTO_set_id_callback__fixed_rust(func: Option<unsafe extern "C" fn() -> c_ulong>); |
| 37 |
} |
| 38 |
|
| 39 |
extern "C" { |
| 40 |
#[cfg(not(ossl110))] |
| 41 |
pub fn CRYPTO_add_lock( |
| 42 |
pointer: *mut c_int, |
| 43 |
amount: c_int, |
| 44 |
type_: c_int, |
| 45 |
file: *const c_char, |
| 46 |
line: c_int, |
| 47 |
) -> c_int; |
| 48 |
} |
| 49 |
|
| 50 |
cfg_if! { |
| 51 |
if #[cfg(any(ossl110, libressl390))] { |
| 52 |
extern "C" { |
| 53 |
pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void; |
| 54 |
pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int); |
| 55 |
} |
| 56 |
} else { |
| 57 |
extern "C" { |
| 58 |
pub fn CRYPTO_malloc(num: c_int, file: *const c_char, line: c_int) -> *mut c_void; |
| 59 |
pub fn CRYPTO_free(buf: *mut c_void); |
| 60 |
} |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
extern "C" { |
| 65 |
#[cfg(all(ossl110, not(ossl300)))] |
| 66 |
pub fn FIPS_mode() -> c_int; |
| 67 |
#[cfg(all(ossl110, not(ossl300)))] |
| 68 |
pub fn FIPS_mode_set(onoff: c_int) -> c_int; |
| 69 |
|
| 70 |
pub fn CRYPTO_memcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int; |
| 71 |
|
| 72 |
#[cfg(ossl300)] |
| 73 |
pub fn OSSL_LIB_CTX_new() -> *mut OSSL_LIB_CTX; |
| 74 |
#[cfg(ossl300)] |
| 75 |
pub fn OSSL_LIB_CTX_free(libcts: *mut OSSL_LIB_CTX); |
| 76 |
} |