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