Skip to content

Commit 5686e16

Browse files
committed
Handle BIO_get_mem_data macro
1 parent 58ba5b2 commit 5686e16

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

openssl-sys/src/lib.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,18 @@ mod aws_lc {
4141
#[cfg(not(feature = "aws-lc"))]
4242
include!(concat!(env!("OUT_DIR"), "/bindgen.rs"));
4343

44+
use libc::{c_char, c_void, c_long};
45+
4446
// AWS-LC does not require initialization.
45-
pub fn init() {}
47+
pub fn init() {
48+
unsafe { CRYPTO_library_init() }
49+
}
50+
51+
// BIO_get_mem_data is a C preprocessor macro by definition
52+
#[allow(non_snake_case, clippy::not_unsafe_ptr_arg_deref)]
53+
pub fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long {
54+
unsafe { BIO_ctrl(b, BIO_CTRL_INFO, 0, pp.cast::<c_void>()) }
55+
}
4656
}
4757
#[cfg(awslc)]
4858
pub use aws_lc::*;

0 commit comments

Comments
 (0)