1mod bindings;
2pub use bindings::*;
3
4#[cfg(test)]
8mod tests {
9 use std::os::raw::c_int;
10 use test_case::test_case;
11
12 use super::*;
13 #[test]
14 fn init_wolfssl() {
15 unsafe {
16 let res = wolfSSL_Init();
17 assert_eq!(res, WOLFSSL_SUCCESS as c_int);
18 }
19 }
20
21 #[cfg(feature = "postquantum")]
22 #[test_case(WOLFSSL_P521_KYBER_LEVEL5)]
23 #[cfg_attr(not(feature = "kyber_only"), test_case(WOLFSSL_P521_ML_KEM_1024))]
24 fn test_post_quantum_available(group: std::os::raw::c_uint) {
25 unsafe {
26 let res = wolfSSL_Init();
28 assert_eq!(res, WOLFSSL_SUCCESS as c_int);
29
30 let method = wolfTLSv1_3_client_method();
32
33 let context = wolfSSL_CTX_new(method);
35
36 let ssl = wolfSSL_new(context);
38
39 let res = wolfSSL_UseKeyShare(ssl, group.try_into().unwrap());
40
41 assert_eq!(res, WOLFSSL_SUCCESS as c_int);
43 }
44 }
45}