Commit bd7d8dcd authored by Steven Fackler's avatar Steven Fackler
Browse files

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

parents e4542efe 16a0e6f6
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -132,3 +132,5 @@ jobs:
        run: cargo run -p systest
      - name: Test openssl
        run: cargo test -p openssl
      - name: Test openssl-errors
        run: cargo test -p openssl-errors
+17 −5
Original line number Diff line number Diff line
@@ -23,7 +23,11 @@ fn basic() {
    assert_eq!(error.library().unwrap(), "test library");
    assert_eq!(error.function().unwrap(), "function foo");
    assert_eq!(error.reason().unwrap(), "out of milk");
    assert_eq!(error.file(), "openssl-errors/tests/test.rs");
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), 20);
    cfg_if! {
        if #[cfg(ossl300)] {
@@ -43,8 +47,12 @@ fn static_data() {
    assert_eq!(error.library().unwrap(), "test library");
    assert_eq!(error.function().unwrap(), "function bar");
    assert_eq!(error.reason().unwrap(), "out of bacon");
    assert_eq!(error.file(), "openssl-errors/tests/test.rs");
    assert_eq!(error.line(), 40);
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), 44);
    assert_eq!(error.data(), Some("foobar"));
}

@@ -56,7 +64,11 @@ fn dynamic_data() {
    assert_eq!(error.library().unwrap(), "test library");
    assert_eq!(error.function().unwrap(), "function bar");
    assert_eq!(error.reason().unwrap(), "out of milk");
    assert_eq!(error.file(), "openssl-errors/tests/test.rs");
    assert_eq!(error.line(), 53);
    // Replace Windows `\` separators with `/`
    assert_eq!(
        error.file().replace(r"\", "/"),
        "openssl-errors/tests/test.rs"
    );
    assert_eq!(error.line(), 61);
    assert_eq!(error.data(), Some("hello world"));
}
+6 −1
Original line number Diff line number Diff line
@@ -101,8 +101,13 @@ pub fn init() {
    // explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
    static INIT: Once = Once::new();

    #[cfg(not(ossl111b))]
    let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS;
    #[cfg(ossl111b)]
    let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS | OPENSSL_INIT_NO_ATEXIT;

    INIT.call_once(|| unsafe {
        OPENSSL_init_ssl(OPENSSL_INIT_LOAD_SSL_STRINGS, ptr::null_mut());
        OPENSSL_init_ssl(init_options, ptr::null_mut());
    })
}

+2 −0
Original line number Diff line number Diff line
@@ -1413,6 +1413,8 @@ cfg_if! {

#[cfg(ossl110)]
pub const OPENSSL_INIT_LOAD_SSL_STRINGS: u64 = 0x00200000;
#[cfg(ossl111b)]
pub const OPENSSL_INIT_NO_ATEXIT: u64 = 0x00080000;

extern "C" {
    #[cfg(ossl110)]
+3 −0
Original line number Diff line number Diff line
@@ -283,6 +283,9 @@ cfg_if! {
        }
    }
}
extern "C" {
    pub fn X509_subject_name_hash(x: *mut ::X509) -> c_ulong;
}
cfg_if! {
    if #[cfg(any(ossl110, libressl280))] {
        extern "C" {
Loading