File tree 1 file changed +5
-1
lines changed
cryptoki-sys/src/bindings
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2891,6 +2891,7 @@ pub type CK_DES_CBC_ENCRYPT_DATA_PARAMS_PTR = *mut ck_des_cbc_encrypt_data_param
2891
2891
pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS = ck_aes_cbc_encrypt_data_params ;
2892
2892
pub type CK_AES_CBC_ENCRYPT_DATA_PARAMS_PTR = * mut ck_aes_cbc_encrypt_data_params ;
2893
2893
extern crate libloading;
2894
+ use libloading:: os:: unix:: RTLD_NOW ;
2894
2895
pub struct Pkcs11 {
2895
2896
__library : :: libloading:: Library ,
2896
2897
pub C_GetFunctionList : Result <
@@ -2903,7 +2904,10 @@ impl Pkcs11 {
2903
2904
where
2904
2905
P : AsRef < :: std:: ffi:: OsStr > ,
2905
2906
{
2906
- let library = :: libloading:: Library :: new ( path) ?;
2907
+ // https://github.com/parallaxsecond/rust-cryptoki/issues/72
2908
+ let RTLD_NODELETE = 0x1000 ;
2909
+ let os_lib = libloading:: os:: unix:: Library :: open ( Some ( path) , RTLD_NOW | RTLD_NODELETE ) ?;
2910
+ let library = libloading:: Library :: from ( os_lib) ;
2907
2911
Self :: from_library ( library)
2908
2912
}
2909
2913
pub unsafe fn from_library < L > ( library : L ) -> Result < Self , :: libloading:: Error >
You can’t perform that action at this time.
0 commit comments