1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(deref_nullptr)]
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn init_wolfssl() {
unsafe {
let res = wolfSSL_Init();
assert_eq!(res, WOLFSSL_SUCCESS);
}
}
#[test]
#[cfg(feature = "postquantum")]
fn test_post_quantum_available() {
unsafe {
let res = wolfSSL_Init();
assert_eq!(res, WOLFSSL_SUCCESS);
let method = wolfTLSv1_3_client_method();
let context = wolfSSL_CTX_new(method);
let ssl = wolfSSL_new(context);
let res = wolfSSL_UseKeyShare(ssl, WOLFSSL_P521_KYBER_LEVEL5.try_into().unwrap());
assert_eq!(res, WOLFSSL_SUCCESS);
}
}
}