Skip to content

Commit ab21823

Browse files
authored
Merge pull request #2287 from botovq/libressl-4
Adjustments for LibreSSL 4
2 parents 36dcae8 + 44c2be5 commit ab21823

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

openssl-sys/src/handwritten/conf.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
use super::super::*;
22

3+
const_ptr_api! {
4+
extern "C" {
5+
pub fn NCONF_new(meth: #[const_ptr_if(libressl400)] CONF_METHOD) -> *mut CONF;
6+
}
7+
}
8+
39
extern "C" {
4-
pub fn NCONF_new(meth: *mut CONF_METHOD) -> *mut CONF;
10+
#[cfg(not(libressl400))]
511
pub fn NCONF_default() -> *mut CONF_METHOD;
612
pub fn NCONF_free(conf: *mut CONF);
713
}

openssl-sys/src/handwritten/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,7 @@ pub struct X509V3_CTX {
472472
subject_cert: *mut c_void,
473473
subject_req: *mut c_void,
474474
crl: *mut c_void,
475+
#[cfg(not(libressl400))]
475476
db_meth: *mut c_void,
476477
db: *mut c_void,
477478
#[cfg(ossl300)]

openssl/build.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fn main() {
3131
println!("cargo:rustc-check-cfg=cfg(libressl380)");
3232
println!("cargo:rustc-check-cfg=cfg(libressl382)");
3333
println!("cargo:rustc-check-cfg=cfg(libressl390)");
34+
println!("cargo:rustc-check-cfg=cfg(libressl400)");
3435

3536
println!("cargo:rustc-check-cfg=cfg(ossl101)");
3637
println!("cargo:rustc-check-cfg=cfg(ossl102)");
@@ -112,6 +113,9 @@ fn main() {
112113
if version >= 0x3_09_00_00_0 {
113114
println!("cargo:rustc-cfg=libressl390");
114115
}
116+
if version >= 0x4_00_00_00_0 {
117+
println!("cargo:rustc-cfg=libressl400");
118+
}
115119
}
116120

117121
if let Ok(vars) = env::var("DEP_OPENSSL_CONF") {

openssl/src/conf.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ foreign_type_and_impl_send_sync! {
88
pub struct ConfRef;
99
}
1010

11-
#[cfg(not(boringssl))]
11+
#[cfg(not(any(boringssl, libressl400)))]
1212
mod methods {
1313
use super::Conf;
1414
use crate::cvt_p;
@@ -61,5 +61,5 @@ mod methods {
6161
}
6262
}
6363
}
64-
#[cfg(not(boringssl))]
64+
#[cfg(not(any(boringssl, libressl400)))]
6565
pub use methods::*;

0 commit comments

Comments
 (0)