Skip to content

Commit

Permalink
LibreSSL 3.9: fix CRYPTO_malloc/free signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
botovq committed Feb 14, 2024
1 parent 51fc569 commit 83940d1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions openssl-sys/src/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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) {
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion openssl-sys/src/handwritten/crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 83940d1

Please sign in to comment.