From 83940d14e30ed4e7c885dd44e3002c1955d5d5ed Mon Sep 17 00:00:00 2001 From: Theo Buehler Date: Wed, 14 Feb 2024 10:06:10 +0100 Subject: [PATCH] LibreSSL 3.9: fix CRYPTO_malloc/free signatures --- openssl-sys/src/crypto.rs | 8 ++++---- openssl-sys/src/handwritten/crypto.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/openssl-sys/src/crypto.rs b/openssl-sys/src/crypto.rs index bdc0add156..7eff6a847b 100644 --- a/openssl-sys/src/crypto.rs +++ b/openssl-sys/src/crypto.rs @@ -57,7 +57,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn( argp: *mut c_void, ); -#[cfg(ossl110)] +#[cfg(any(ossl110, libressl390))] #[inline] #[track_caller] pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void { @@ -68,7 +68,7 @@ pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void { ) } -#[cfg(not(ossl110))] +#[cfg(not(any(ossl110, libressl390)))] #[inline] #[track_caller] pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void { @@ -79,7 +79,7 @@ pub unsafe fn OPENSSL_malloc(num: c_int) -> *mut c_void { ) } -#[cfg(ossl110)] +#[cfg(any(ossl110, libressl390))] #[inline] #[track_caller] pub unsafe fn OPENSSL_free(addr: *mut c_void) { @@ -90,7 +90,7 @@ pub unsafe fn OPENSSL_free(addr: *mut c_void) { ) } -#[cfg(not(ossl110))] +#[cfg(not(any(ossl110, libressl390)))] #[inline] pub unsafe fn OPENSSL_free(addr: *mut c_void) { CRYPTO_free(addr) diff --git a/openssl-sys/src/handwritten/crypto.rs b/openssl-sys/src/handwritten/crypto.rs index 62ccbce1ec..0b3f24a429 100644 --- a/openssl-sys/src/handwritten/crypto.rs +++ b/openssl-sys/src/handwritten/crypto.rs @@ -57,7 +57,7 @@ extern "C" { } cfg_if! { - if #[cfg(ossl110)] { + if #[cfg(any(ossl110, libressl390))] { extern "C" { pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void; pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);