Skip to content

Commit a644ec2

Browse files
authored
Merge pull request #2170 from botovq/crypto-free
LibreSSL 3.9: fix CRYPTO_malloc/free signatures
2 parents 51fc569 + 83940d1 commit a644ec2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

openssl-sys/src/crypto.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub type CRYPTO_EX_free = unsafe extern "C" fn(
5757
argp: *mut c_void,
5858
);
5959

60-
#[cfg(ossl110)]
60+
#[cfg(any(ossl110, libressl390))]
6161
#[inline]
6262
#[track_caller]
6363
pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
@@ -68,7 +68,7 @@ pub unsafe fn OPENSSL_malloc(num: usize) -> *mut c_void {
6868
)
6969
}
7070

71-
#[cfg(not(ossl110))]
71+
#[cfg(not(any(ossl110, libressl390)))]
7272
#[inline]
7373
#[track_caller]
7474
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 {
7979
)
8080
}
8181

82-
#[cfg(ossl110)]
82+
#[cfg(any(ossl110, libressl390))]
8383
#[inline]
8484
#[track_caller]
8585
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
@@ -90,7 +90,7 @@ pub unsafe fn OPENSSL_free(addr: *mut c_void) {
9090
)
9191
}
9292

93-
#[cfg(not(ossl110))]
93+
#[cfg(not(any(ossl110, libressl390)))]
9494
#[inline]
9595
pub unsafe fn OPENSSL_free(addr: *mut c_void) {
9696
CRYPTO_free(addr)

openssl-sys/src/handwritten/crypto.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ extern "C" {
5757
}
5858

5959
cfg_if! {
60-
if #[cfg(ossl110)] {
60+
if #[cfg(any(ossl110, libressl390))] {
6161
extern "C" {
6262
pub fn CRYPTO_malloc(num: size_t, file: *const c_char, line: c_int) -> *mut c_void;
6363
pub fn CRYPTO_free(buf: *mut c_void, file: *const c_char, line: c_int);

0 commit comments

Comments
 (0)