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

Fix link errors for X509_get0_authority_xxx methods on Ubuntu/bionic #1909

Merged
merged 2 commits into from
Apr 26, 2023
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
3 changes: 3 additions & 0 deletions openssl-sys/build/cfgs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ pub fn get(openssl_version: Option<u64>, libressl_version: Option<u64>) -> Vec<&
if openssl_version >= 0x1_01_01_03_0 {
cfgs.push("ossl111c");
}
if openssl_version >= 0x1_01_01_04_0 {
cfgs.push("ossl111d");
}
}

cfgs
Expand Down
8 changes: 6 additions & 2 deletions openssl-sys/src/handwritten/ssl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,13 @@ extern "C" {
#[cfg(ossl111)]
pub fn SSL_set_num_tickets(s: *mut SSL, num_tickets: size_t) -> c_int;

#[cfg(ossl111)]
#[cfg(ossl111b)]
pub fn SSL_CTX_get_num_tickets(ctx: *const SSL_CTX) -> size_t;
#[cfg(all(ossl111, not(ossl111b)))]
pub fn SSL_CTX_get_num_tickets(ctx: *mut SSL_CTX) -> size_t;

#[cfg(ossl111)]
#[cfg(ossl111b)]
pub fn SSL_get_num_tickets(s: *const SSL) -> size_t;
#[cfg(all(ossl111, not(ossl111b)))]
pub fn SSL_get_num_tickets(s: *mut SSL) -> size_t;
}
4 changes: 2 additions & 2 deletions openssl-sys/src/handwritten/x509v3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ extern "C" {
pub fn X509_get0_subject_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
#[cfg(ossl110)]
pub fn X509_get0_authority_key_id(x: *mut X509) -> *const ASN1_OCTET_STRING;
#[cfg(ossl111)]
#[cfg(ossl111d)]
pub fn X509_get0_authority_issuer(x: *mut X509) -> *const stack_st_GENERAL_NAME;
#[cfg(ossl111)]
#[cfg(ossl111d)]
pub fn X509_get0_authority_serial(x: *mut X509) -> *const ASN1_INTEGER;
}

Expand Down
4 changes: 2 additions & 2 deletions openssl/src/x509/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ impl X509Ref {

/// Returns this certificate's authority issuer name entries, if they exist.
#[corresponds(X509_get0_authority_issuer)]
#[cfg(ossl111)]
#[cfg(ossl111d)]
pub fn authority_issuer(&self) -> Option<&StackRef<GeneralName>> {
unsafe {
let stack = ffi::X509_get0_authority_issuer(self.as_ptr());
Expand All @@ -515,7 +515,7 @@ impl X509Ref {

/// Returns this certificate's authority serial number, if it exists.
#[corresponds(X509_get0_authority_serial)]
#[cfg(ossl111)]
#[cfg(ossl111d)]
pub fn authority_serial(&self) -> Option<&Asn1IntegerRef> {
unsafe {
let r = ffi::X509_get0_authority_serial(self.as_ptr());
Expand Down
2 changes: 1 addition & 1 deletion openssl/src/x509/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn test_authority_key_id() {
}

#[test]
#[cfg(ossl111)]
#[cfg(ossl111d)]
fn test_authority_issuer_and_serial() {
let cert = include_bytes!("../../test/authority_key_identifier.pem");
let cert = X509::from_pem(cert).unwrap();
Expand Down