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/hash.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/hash.rs')
| -rw-r--r-- | src/crypto/hash.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/crypto/hash.rs b/src/crypto/hash.rs index 61221cb5..a72b8d9f 100644 --- a/src/crypto/hash.rs +++ b/src/crypto/hash.rs @@ -36,6 +36,8 @@ pub struct Hasher { impl Hasher { pub fn new(ht: HashType) -> Hasher { + ffi::init(); + let ctx = unsafe { ffi::EVP_MD_CTX_create() }; let (evp, mdlen) = evpmd(ht); unsafe { |