Loading .github/workflows/ci.yml +2 −0 Original line number Diff line number Diff line Loading @@ -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 openssl-errors/tests/test.rs +17 −5 Original line number Diff line number Diff line Loading @@ -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)] { Loading @@ -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")); } Loading @@ -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")); } openssl-sys/src/lib.rs +6 −1 Original line number Diff line number Diff line Loading @@ -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()); }) } Loading openssl-sys/src/ssl.rs +2 −0 Original line number Diff line number Diff line Loading @@ -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)] Loading openssl-sys/src/x509.rs +3 −0 Original line number Diff line number Diff line Loading @@ -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 Loading
.github/workflows/ci.yml +2 −0 Original line number Diff line number Diff line Loading @@ -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
openssl-errors/tests/test.rs +17 −5 Original line number Diff line number Diff line Loading @@ -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)] { Loading @@ -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")); } Loading @@ -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")); }
openssl-sys/src/lib.rs +6 −1 Original line number Diff line number Diff line Loading @@ -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()); }) } Loading
openssl-sys/src/ssl.rs +2 −0 Original line number Diff line number Diff line Loading @@ -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)] Loading
openssl-sys/src/x509.rs +3 −0 Original line number Diff line number Diff line Loading @@ -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