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

Adjustments for LibreSSL 4 #2287

Merged
merged 3 commits into from
Aug 30, 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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion openssl-sys/src/handwritten/conf.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
use super::super::*;

const_ptr_api! {
extern "C" {
pub fn NCONF_new(meth: #[const_ptr_if(libressl400)] CONF_METHOD) -> *mut CONF;
}
}

extern "C" {
pub fn NCONF_new(meth: *mut CONF_METHOD) -> *mut CONF;
#[cfg(not(libressl400))]
pub fn NCONF_default() -> *mut CONF_METHOD;
pub fn NCONF_free(conf: *mut CONF);
}
1 change: 1 addition & 0 deletions openssl-sys/src/handwritten/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ pub struct X509V3_CTX {
subject_cert: *mut c_void,
subject_req: *mut c_void,
crl: *mut c_void,
#[cfg(not(libressl400))]
db_meth: *mut c_void,
db: *mut c_void,
#[cfg(ossl300)]
Expand Down
4 changes: 4 additions & 0 deletions openssl/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ fn main() {
println!("cargo:rustc-check-cfg=cfg(libressl380)");
println!("cargo:rustc-check-cfg=cfg(libressl382)");
println!("cargo:rustc-check-cfg=cfg(libressl390)");
println!("cargo:rustc-check-cfg=cfg(libressl400)");

println!("cargo:rustc-check-cfg=cfg(ossl101)");
println!("cargo:rustc-check-cfg=cfg(ossl102)");
Expand Down Expand Up @@ -112,6 +113,9 @@ fn main() {
if version >= 0x3_09_00_00_0 {
println!("cargo:rustc-cfg=libressl390");
}
if version >= 0x4_00_00_00_0 {
println!("cargo:rustc-cfg=libressl400");
}
}

if let Ok(vars) = env::var("DEP_OPENSSL_CONF") {
Expand Down
4 changes: 2 additions & 2 deletions openssl/src/conf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ foreign_type_and_impl_send_sync! {
pub struct ConfRef;
}

#[cfg(not(boringssl))]
#[cfg(not(any(boringssl, libressl400)))]
mod methods {
use super::Conf;
use crate::cvt_p;
Expand Down Expand Up @@ -61,5 +61,5 @@ mod methods {
}
}
}
#[cfg(not(boringssl))]
#[cfg(not(any(boringssl, libressl400)))]
pub use methods::*;