Commit 2dc1290c authored by Steven Fackler's avatar Steven Fackler
Browse files

Merge remote-tracking branch 'origin/master' into openssl-300

parents bd7d8dcd f958176b
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -177,13 +177,11 @@ jobs:
        type: string
        default: 1.33.0
    macos:
      xcode: "9.0"
      xcode: "12.2.0"
    environment:
      RUST_BACKTRACE: 1
    steps:
      - checkout
      - run: sudo mkdir /opt
      - run: sudo chown -R $USER /usr/local/ /opt
      - run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain << parameters.image >>
      - run: sudo ln -s ~/.cargo/bin/* /usr/local/bin
      - run: cargo generate-lockfile
@@ -212,7 +210,7 @@ openssl_300: &openssl_300
  version: 3.0.0-alpha6
openssl_111: &openssl_111
  library: openssl
  version: 1.1.1g
  version: 1.1.1h
openssl_110: &openssl_110
  library: openssl
  version: 1.1.0l
+1 −0
Original line number Diff line number Diff line
@@ -276,6 +276,7 @@ due to this version mismatch.

// parses a string that looks like "0x100020cfL"
#[allow(deprecated)] // trim_right_matches is now trim_end_matches
#[allow(clippy::match_like_matches_macro)] // matches macro requires rust 1.42.0
fn parse_version(version: &str) -> u64 {
    // cut off the 0x prefix
    assert!(version.starts_with("0x"));
+3 −9
Original line number Diff line number Diff line
@@ -61,14 +61,8 @@ extern "C" {
    pub fn ASN1_TIME_set_string_X509(s: *mut ASN1_TIME, str: *const c_char) -> c_int;
}

cfg_if! {
    if #[cfg(any(ossl110, libressl280))] {
const_ptr_api! {
    extern "C" {
            pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *const ASN1_STRING) -> c_int;
        }
    } else {
        extern "C" {
            pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: *mut ASN1_STRING) -> c_int;
        }
        pub fn ASN1_STRING_to_UTF8(out: *mut *mut c_uchar, s: #[const_ptr_if(any(ossl110, libressl280))] ASN1_STRING) -> c_int;
    }
}
+8 −31
Original line number Diff line number Diff line
@@ -60,17 +60,10 @@ pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long {
    BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void)
}

cfg_if! {
    if #[cfg(any(ossl110, libressl280))] {
        extern "C" {
            pub fn BIO_s_file() -> *const BIO_METHOD;
            pub fn BIO_new(type_: *const BIO_METHOD) -> *mut BIO;
        }
    } else {
const_ptr_api! {
    extern "C" {
            pub fn BIO_s_file() -> *mut BIO_METHOD;
            pub fn BIO_new(type_: *mut BIO_METHOD) -> *mut BIO;
        }
        pub fn BIO_s_file() -> #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD;
        pub fn BIO_new(type_: #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD) -> *mut BIO;
    }
}
extern "C" {
@@ -88,26 +81,10 @@ extern "C" {
    pub fn BIO_free_all(b: *mut BIO);
}

cfg_if! {
    if #[cfg(any(ossl110, libressl280))] {
        extern "C" {
            pub fn BIO_s_mem() -> *const BIO_METHOD;
        }
    } else {
        extern "C" {
            pub fn BIO_s_mem() -> *mut BIO_METHOD;
        }
    }
}
cfg_if! {
    if #[cfg(any(ossl102, libressl280))] {
const_ptr_api! {
    extern "C" {
            pub fn BIO_new_mem_buf(buf: *const c_void, len: c_int) -> *mut BIO;
        }
    } else {
        extern "C" {
            pub fn BIO_new_mem_buf(buf: *mut c_void, len: c_int) -> *mut BIO;
        }
        pub fn BIO_s_mem() -> #[const_ptr_if(any(ossl110, libressl280))] BIO_METHOD;
        pub fn BIO_new_mem_buf(buf: #[const_ptr_if(any(ossl102, libressl280))] c_void, len: c_int) -> *mut BIO;
    }
}

+2 −2
Original line number Diff line number Diff line
@@ -13,8 +13,8 @@ cfg_if! {

        pub const ERR_LIB_OFFSET: c_ulong = 23;
        pub const ERR_LIB_MASK: c_ulong = 0xff;
        pub const ERR_RFLAGS_OFFSET: c_ulong = 19;
        pub const ERR_RFLAGS_MASK: c_ulong = 0xf;
        pub const ERR_RFLAGS_OFFSET: c_ulong = 18;
        pub const ERR_RFLAGS_MASK: c_ulong = 0x1f;
        pub const ERR_REASON_MASK: c_ulong = 0x7FFFFF;

        pub const ERR_RFLAG_FATAL: c_ulong = 0x1 << ERR_RFLAGS_OFFSET;
Loading