Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LibreSSL 3.9: fix CRYPTO_malloc/free signatures #2170

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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