Skip to content

Commit

Permalink
Merge pull request #2145 from botovq/opaque-purpose
Browse files Browse the repository at this point in the history
Make X509_PURPOSE opaque for LibreSSL >= 3.9.0
  • Loading branch information
alex committed Jan 11, 2024
2 parents 772b0b1 + bff0db7 commit 06143eb
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions openssl-sys/src/handwritten/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,16 +687,22 @@ extern "C" {
pub fn X509_REQ_print(bio: *mut BIO, req: *mut X509_REQ) -> c_int;
}

#[repr(C)]
pub struct X509_PURPOSE {
pub purpose: c_int,
pub trust: c_int, // Default trust ID
pub flags: c_int,
pub check_purpose:
Option<unsafe extern "C" fn(*const X509_PURPOSE, *const X509, c_int) -> c_int>,
pub name: *mut c_char,
pub sname: *mut c_char,
pub usr_data: *mut c_void,
cfg_if! {
if #[cfg(libressl390)] {
pub enum X509_PURPOSE {}
} else {
#[repr(C)]
pub struct X509_PURPOSE {
pub purpose: c_int,
pub trust: c_int, // Default trust ID
pub flags: c_int,
pub check_purpose:
Option<unsafe extern "C" fn(*const X509_PURPOSE, *const X509, c_int) -> c_int>,
pub name: *mut c_char,
pub sname: *mut c_char,
pub usr_data: *mut c_void,
}
}
}

const_ptr_api! {
Expand Down

0 comments on commit 06143eb

Please sign in to comment.