Skip to content

Commit a613d4b

Browse files
committed
Clean up boring_sys::init()
We don't need the workaround that was initially introduced for a bug in openssl, and OPENSSL_init_ssl always calls into CRYPTO_library_init on boringssl, so just call it explicitly.
1 parent 3b36cb6 commit a613d4b

File tree

1 file changed

+3
-14
lines changed

1 file changed

+3
-14
lines changed

boring-sys/src/lib.rs

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,7 @@ pub const fn ERR_GET_REASON(l: c_uint) -> c_int {
4848
}
4949

5050
pub fn init() {
51-
use std::ptr;
52-
use std::sync::Once;
53-
54-
// explicitly initialize to work around https://github.com/openssl/openssl/issues/3505
55-
static INIT: Once = Once::new();
56-
57-
let init_options = OPENSSL_INIT_LOAD_SSL_STRINGS;
58-
59-
INIT.call_once(|| {
60-
assert_eq!(
61-
unsafe { OPENSSL_init_ssl(init_options.try_into().unwrap(), ptr::null_mut()) },
62-
1
63-
)
64-
});
51+
unsafe {
52+
CRYPTO_library_init();
53+
}
6554
}

0 commit comments

Comments
 (0)