Skip to content

Fix SIGSEGV upon pkcs11.open_session_no_callbac #73

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

Closed
wants to merge 1 commit into from
Closed
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
6 changes: 5 additions & 1 deletion cryptoki-sys/src/bindings/x86_64-unknown-linux-gnu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,7 @@ pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_param
pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params;
pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_aes_cbc_encrypt_data_params;
extern crate libloading;
use libloading::os::unix::RTLD_NOW;
pub struct Pkcs11 {
__library: ::libloading::Library,
pub C_GetFunctionList: Result<
Expand All @@ -2903,7 +2904,10 @@ impl Pkcs11 {
where
P: AsRef<::std::ffi::OsStr>,
{
let library = ::libloading::Library::new(path)?;
// https://github.com/parallaxsecond/rust-cryptoki/issues/72
let RTLD_NODELETE = 0x1000;
let os_lib = libloading::os::unix::Library::open(Some(path), RTLD_NOW | RTLD_NODELETE)?;
let library = libloading::Library::from(os_lib);
Self::from_library(library)
}
pub unsafe fn from_library<L>(library: L) -> Result<Self, ::libloading::Error>
Expand Down