diff options
| author | Valerii Hiora <[email protected]> | 2014-10-13 17:41:03 +0300 |
|---|---|---|
| committer | Valerii Hiora <[email protected]> | 2014-10-14 08:31:42 +0300 |
| commit | dd46d1922e4706cf4c15c8cd915c1254363def8c (patch) | |
| tree | 9be063d21a6ca4c90f20be1dd54d0dc3144b959f /src/crypto/pkcs5.rs | |
| parent | Merge pull request #83 from jmesmon/set-cipher-list (diff) | |
| download | rust-openssl-dd46d1922e4706cf4c15c8cd915c1254363def8c.tar.xz rust-openssl-dd46d1922e4706cf4c15c8cd915c1254363def8c.zip | |
Correct init mutexes and locking function
`libcrypto` uses locks quite intensively even without SSL.
So they should be initialized before everything else to
function properly in multi-threaded apps in which SSL
operations are absent or delayed.
Finishes #79
Diffstat (limited to 'src/crypto/pkcs5.rs')
| -rw-r--r-- | src/crypto/pkcs5.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/pkcs5.rs b/src/crypto/pkcs5.rs index ec6e0cef..feaff9c8 100644 --- a/src/crypto/pkcs5.rs +++ b/src/crypto/pkcs5.rs @@ -9,6 +9,8 @@ pub fn pbkdf2_hmac_sha1(pass: &str, salt: &[u8], iter: uint, keylen: uint) -> Ve let mut out = Vec::with_capacity(keylen); + ffi::init(); + let r = ffi::PKCS5_PBKDF2_HMAC_SHA1( pass.as_ptr(), pass.len() as c_int, salt.as_ptr(), salt.len() as c_int, |